-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from CMP26Projects/activity
Activity
- Loading branch information
Showing
7 changed files
with
125 additions
and
33 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
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
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,26 @@ | ||
import { apiSlice } from "./apiSlice"; | ||
|
||
const ACTIVITIES_URL = "/api/activities"; | ||
|
||
export const activitiesApi = apiSlice.injectEndpoints({ | ||
endpoints: (builder) => ({ | ||
GetAllActivities: builder.query({ | ||
query: () => ({ | ||
url: `${ACTIVITIES_URL}/all`, | ||
method: "GET", | ||
}), | ||
providesTags: ["activites"], | ||
}), | ||
InsertActivity: builder.mutation({ | ||
query: (activity) => ({ | ||
url: `${ACTIVITIES_URL}`, | ||
method: "POST", | ||
body: activity, | ||
}), | ||
invalidatesTags: ["activites"], | ||
}), | ||
}), | ||
}); | ||
|
||
export const { useGetAllActivitiesQuery, useInsertActivityMutation } = | ||
activitiesApi; |
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ export const apiSlice = createApi({ | |
"auth", | ||
"sector", | ||
"alert", | ||
"activites", | ||
], | ||
endpoints: () => ({}), | ||
}); |
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