mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
enhancement: reusable api client setup + replaced in settings, conversation
This commit is contained in:
23
frontend/src/api/services/userService.ts
Normal file
23
frontend/src/api/services/userService.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import apiClient from '../client';
|
||||
import endpoints from '../endpoints';
|
||||
|
||||
const userService = {
|
||||
getAPIKeys: (): Promise<any> => apiClient.get(endpoints.USER.API_KEYS),
|
||||
createAPIKey: (data: any): Promise<any> =>
|
||||
apiClient.post(endpoints.USER.CREATE_API_KEY, data),
|
||||
deleteAPIKey: (data: any): Promise<any> =>
|
||||
apiClient.post(endpoints.USER.DELETE_API_KEY, data),
|
||||
getPrompts: (): Promise<any> => apiClient.get(endpoints.USER.PROMPTS),
|
||||
createPrompt: (data: any): Promise<any> =>
|
||||
apiClient.post(endpoints.USER.CREATE_PROMPT, data),
|
||||
deletePrompt: (data: any): Promise<any> =>
|
||||
apiClient.post(endpoints.USER.DELETE_PROMPT, data),
|
||||
updatePrompt: (data: any): Promise<any> =>
|
||||
apiClient.post(endpoints.USER.UPDATE_PROMPT, data),
|
||||
getSinglePrompt: (id: string): Promise<any> =>
|
||||
apiClient.get(endpoints.USER.SINGLE_PROMPT(id)),
|
||||
deletePath: (docPath: string): Promise<any> =>
|
||||
apiClient.get(endpoints.USER.DELETE_PATH(docPath)),
|
||||
};
|
||||
|
||||
export default userService;
|
||||
Reference in New Issue
Block a user