mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
🎨 ♻️ deleteDocument, reponse types
This commit is contained in:
5
packages/lib/api/deleteDocument.ts
Normal file
5
packages/lib/api/deleteDocument.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export const deleteDocument = (documentId: number): Promise<Response> => {
|
||||
return fetch(`/api/documents/${documentId}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
};
|
||||
@ -1,4 +1,4 @@
|
||||
export const getDocuments = (): any => {
|
||||
export const getDocuments = (): Promise<Response> => {
|
||||
return fetch("/api/documents", {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export const getUser = (): Promise<any> => {
|
||||
export const getUser = (): Promise<Response> => {
|
||||
return fetch("/api/users/me");
|
||||
};
|
||||
|
||||
@ -4,3 +4,4 @@ export { signDocument } from "./signDocument";
|
||||
export { getUser } from "./getUser";
|
||||
export { signup } from "./signup";
|
||||
export { getDocuments } from "./getDocuments";
|
||||
export { deleteDocument } from "./deleteDocument";
|
||||
@ -1,4 +1,4 @@
|
||||
export const signup = (source: any, data: any) => {
|
||||
export const signup = (source: any, data: any): Promise<Response> => {
|
||||
return fetch("/api/auth/signup", {
|
||||
body: JSON.stringify({
|
||||
source: source,
|
||||
|
||||
Reference in New Issue
Block a user