🎨 ♻️ deleteDocument, reponse types

This commit is contained in:
Timur Ercan
2023-03-01 15:31:43 +01:00
parent 9bd409e113
commit 891f032468
6 changed files with 11 additions and 7 deletions

View File

@ -0,0 +1,5 @@
export const deleteDocument = (documentId: number): Promise<Response> => {
return fetch(`/api/documents/${documentId}`, {
method: "DELETE",
});
};

View File

@ -1,4 +1,4 @@
export const getDocuments = (): any => {
export const getDocuments = (): Promise<Response> => {
return fetch("/api/documents", {
headers: {
"Content-Type": "application/json",

View File

@ -1,3 +1,3 @@
export const getUser = (): Promise<any> => {
export const getUser = (): Promise<Response> => {
return fetch("/api/users/me");
};

View File

@ -4,3 +4,4 @@ export { signDocument } from "./signDocument";
export { getUser } from "./getUser";
export { signup } from "./signup";
export { getDocuments } from "./getDocuments";
export { deleteDocument } from "./deleteDocument";

View File

@ -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,