Commit ac45f741 by Arjun Jhukal

updated the minor changes

parent 690b37e0
...@@ -13,26 +13,30 @@ export const pageApi = createApi({ ...@@ -13,26 +13,30 @@ export const pageApi = createApi({
url: "/api/admin/page/store", url: "/api/admin/page/store",
method: "POST", method: "POST",
body: body body: body
}) }),
invalidatesTags: ['pages']
}), }),
getAllPage: builder.query<PageListResponse, QueryParams>({ getAllPage: builder.query<PageListResponse, QueryParams>({
query: (body) => ({ query: (body) => ({
url: "/api/admin/page/list", url: "/api/admin/page/list",
method: "GET", method: "GET",
}) }),
providesTags: ['pages']
}), }),
updatePageById: builder.mutation<GlobalResponse, { id: string, body: FormData }>({ updatePageById: builder.mutation<GlobalResponse, { id: string, body: FormData }>({
query: ({ id, body }) => ({ query: ({ id, body }) => ({
url: `/api/admin/page/update/${id}`, url: `/api/admin/page/update/${id}`,
method: "POST", method: "POST",
body: body body: body
}) }),
invalidatesTags: ['pages']
}), }),
deletePageById: builder.mutation<GlobalResponse, { id: string }>({ deletePageById: builder.mutation<GlobalResponse, { id: string }>({
query: ({ id }) => ({ query: ({ id }) => ({
url: `/api/admin/page/delete/${id}`, url: `/api/admin/page/delete/${id}`,
method: "DELETE", method: "DELETE",
}) }),
invalidatesTags: ['pages']
}) })
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment