diff --git a/decide/administration/frontend/src/api/baseApiUtils.ts b/decide/administration/frontend/src/api/baseApiUtils.ts new file mode 100644 index 0000000000..c7a931e4d3 --- /dev/null +++ b/decide/administration/frontend/src/api/baseApiUtils.ts @@ -0,0 +1,30 @@ +import { axios } from "api/axios"; + + +const baseApi = { + // KEYS OPERATIONS + //Bulk operation + getKeys: () => axios.get("/base/key"), + deleteKeys: () => axios.delete(`/base/key/`), + + //Individual operations + getKey: (id: string) => axios.get(`/base/key/${id}`), + createKey: (key: any) => axios.post("/base/key/", key), + updateKey: (key: any) => axios.put(`/base/key/${key.id}`, key), + deleteKey: (id: string) => axios.delete(`/base/key/${id}`), + + + // AUTH OPERATIONS + //Bulk operation + getAuths: () => axios.get("/base/auth"), + createAuth: (auth: any) => axios.post("/base/auth/", auth), + deleteAuths: () => axios.delete(`/base/auth`), + + //Individual operations + getAuth: (id: string) => axios.get(`/base/auth/${id}`), + updateAuth: (auth: any) => axios.put(`/base/auth/${auth.id}`, auth), + deleteAuth: (id: string) => axios.delete(`/base/auth/${id}`) +}; + + +export default baseApi; \ No newline at end of file diff --git a/decide/administration/frontend/src/api/userApiUtils.ts b/decide/administration/frontend/src/api/userApiUtils.ts index 1ab76f6b05..b4d7803b17 100644 --- a/decide/administration/frontend/src/api/userApiUtils.ts +++ b/decide/administration/frontend/src/api/userApiUtils.ts @@ -3,6 +3,8 @@ import { axios } from "api/axios"; const userApi = { // bulk operations getUsers: () => axios.get("/users"), + //createUsers: (user: any) => axios.post("/users/", user), + deleteUsers: () => axios.delete("/users"), // individual operations getUser: (id: string) => axios.get(`/users/${id}`), @@ -11,4 +13,5 @@ const userApi = { deleteUser: (id: string) => axios.delete(`/users/${id}`), }; + export default userApi;