-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db9a9b3
commit 4abc06d
Showing
13 changed files
with
172 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { configureStore } from '@reduxjs/toolkit' | ||
import authReducer from '../features/auth/authSlice' | ||
import ticketReducer from '../features/tickets/ticketSlice' | ||
import noteReducer from '../features/notes/noteSlice' | ||
import blogReducer from '../features/blog/blogSlice' | ||
|
||
export const store = configureStore({ | ||
reducer: { | ||
auth: authReducer, | ||
tickets: ticketReducer, | ||
notes: noteReducer, | ||
blog: blogReducer, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import axios from 'axios' | ||
|
||
const API_URL = 'http://localhost:8000/blog' | ||
|
||
// Create new post | ||
const createBlog = async (postData, token) => { | ||
const config = { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
} | ||
|
||
const response = await axios.post(API_URL, postData, config) | ||
|
||
return response.data | ||
} | ||
|
||
// Get user blog posts | ||
const getPosts = async (token) => { | ||
const config = { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
} | ||
|
||
const response = await axios.get(API_URL, config) | ||
console.log('Response is ', response) | ||
return response.data | ||
} | ||
|
||
const blogService = { | ||
createBlog, | ||
getPosts, | ||
} | ||
|
||
export default blogService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.