mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 05:42:39 +02:00
add is_public to frontend types and API service
This commit is contained in:
parent
24fd19a394
commit
16884963a4
2 changed files with 21 additions and 1 deletions
|
|
@ -4,8 +4,9 @@ import {
|
|||
promptCreateRequest,
|
||||
promptDeleteResponse,
|
||||
promptRead,
|
||||
promptUpdateRequest,
|
||||
promptsListResponse,
|
||||
promptUpdateRequest,
|
||||
publicPromptsListResponse,
|
||||
} from "@/contracts/types/prompts.types";
|
||||
import { ValidationError } from "@/lib/error";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
|
@ -49,6 +50,14 @@ class PromptsApiService {
|
|||
delete = async (promptId: number) => {
|
||||
return baseApiService.delete(`/api/v1/prompts/${promptId}`, promptDeleteResponse);
|
||||
};
|
||||
|
||||
listPublic = async () => {
|
||||
return baseApiService.get("/api/v1/prompts/public", publicPromptsListResponse);
|
||||
};
|
||||
|
||||
copy = async (promptId: number) => {
|
||||
return baseApiService.post(`/api/v1/prompts/${promptId}/copy`, promptRead, {});
|
||||
};
|
||||
}
|
||||
|
||||
export const promptsApiService = new PromptsApiService();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue