18 lines
538 B
TypeScript
18 lines
538 B
TypeScript
import axios from "@/config/axios";
|
|
import { TemplateType, TemplatesResponseType } from "../types/Types";
|
|
|
|
export const saveTemplate = async (params: TemplateType) => {
|
|
const { data } = await axios.post("/templates", params);
|
|
return data;
|
|
};
|
|
|
|
export const getTemplates = async (): Promise<TemplatesResponseType> => {
|
|
const { data } = await axios.get("/templates");
|
|
return data;
|
|
};
|
|
|
|
export const setSelectedTemplate = async (id: string) => {
|
|
const { data } = await axios.patch(`/templates/${id}/set-selected`);
|
|
return data;
|
|
};
|