Skip to content

Commit

Permalink
Fix Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
iwansuryaningrat committed Sep 8, 2024
1 parent 162d14a commit f7cd59a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Install game-api with yarn
Clone the project

```bash
git clone https://github.com/sningratGames/game-admin-panel.git
git clone https://github.com/educational-game-project/game-admin-panel
```

Go to the project directory
Expand Down
10 changes: 5 additions & 5 deletions src/services/gameApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export const gameApi = coreApi.injectEndpoints({
endpoints: (builder) => ({
getGame: builder.mutation<GameListSuccessResponse, DataTableGetRequest>({
query: (data) => ({
url: "/games/find",
url: "/game/find",
method: "POST",
body: data,
}),
}),
getGameById: builder.mutation<GameSuccessResponse, GameIdRequest>({
query: (id) => ({
url: "/games/detail",
url: "/game/detail",
method: "POST",
body: id,
}),
Expand All @@ -40,7 +40,7 @@ export const gameApi = coreApi.injectEndpoints({
});
}
return {
url: "/games",
url: "/game",
method: "POST",
body: formDefineGame,
formData: true,
Expand All @@ -65,7 +65,7 @@ export const gameApi = coreApi.injectEndpoints({
});
}
return {
url: "/games",
url: "/game",
method: "PUT",
body: formEditGame,
formData: true,
Expand All @@ -75,7 +75,7 @@ export const gameApi = coreApi.injectEndpoints({
}),
deleteGame: builder.mutation<SuccessResponse, GameIdRequest>({
query: (id) => ({
url: "/games",
url: "/game",
method: "DELETE",
body: id,
}),
Expand Down
4 changes: 2 additions & 2 deletions src/services/logApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export const logApi = coreApi.injectEndpoints({
endpoints: (builder) => ({
getLogs: builder.mutation<LogListSuccessResponse, DataTableGetRequest>({
query: (data) => ({
url: "/logs",
url: "/log/find",
method: "POST",
body: data,
}),
}),
deleteLog: builder.mutation<SuccessResponse, LogIdRequest>({
query: (id) => ({
url: "/logs",
url: "/log",
method: "DELETE",
body: id,
}),
Expand Down
10 changes: 5 additions & 5 deletions src/services/schoolApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export const schoolApi = coreApi.injectEndpoints({
getSchool: builder.mutation<SchoolListSuccessResponse, DataTableGetRequest>(
{
query: (data) => ({
url: "/schools/find",
url: "/school/find",
method: "POST",
body: data,
}),
}
),
getSchoolById: builder.mutation<SchoolSuccessResponse, SchoolIdRequest>({
query: (id) => ({
url: "/schools/detail",
url: "/school/detail",
method: "POST",
body: id,
}),
Expand All @@ -35,7 +35,7 @@ export const schoolApi = coreApi.injectEndpoints({
formAddSchool.append("media", data?.media[0] || "");
}
return {
url: "/schools",
url: "/school",
method: "POST",
body: formAddSchool,
formData: true,
Expand All @@ -53,7 +53,7 @@ export const schoolApi = coreApi.injectEndpoints({
formEditSchool.append("media", data?.media[0] || "");
}
return {
url: "/schools",
url: "/school",
method: "PUT",
body: formEditSchool,
formData: true,
Expand All @@ -63,7 +63,7 @@ export const schoolApi = coreApi.injectEndpoints({
}),
deleteSchool: builder.mutation<SuccessResponse, SchoolIdRequest>({
query: (id) => ({
url: "/schools",
url: "/school",
method: "DELETE",
body: id,
}),
Expand Down

0 comments on commit f7cd59a

Please sign in to comment.