mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: format with prettier
This commit is contained in:
parent
03fb09c3d6
commit
a147ad6610
164 changed files with 11257 additions and 8154 deletions
|
|
@ -1,5 +1,9 @@
|
|||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody, errorHandling, RequestBodyForm } from "@services/utils/ts/requests";
|
||||
import { getAPIUrl } from '@services/config/config'
|
||||
import {
|
||||
RequestBody,
|
||||
errorHandling,
|
||||
RequestBodyForm,
|
||||
} from '@services/utils/ts/requests'
|
||||
|
||||
/*
|
||||
This file includes only POST, PUT, DELETE requests
|
||||
|
|
@ -7,16 +11,22 @@ import { RequestBody, errorHandling, RequestBodyForm } from "@services/utils/ts/
|
|||
*/
|
||||
|
||||
export async function updateOrganization(org_id: string, data: any) {
|
||||
const result: any = await fetch(`${getAPIUrl()}orgs/` + org_id, RequestBody("PUT", data, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}orgs/` + org_id,
|
||||
RequestBody('PUT', data, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function uploadOrganizationLogo(org_id: string, logo_file: any) {
|
||||
// Send file thumbnail as form data
|
||||
const formData = new FormData();
|
||||
formData.append("logo_file", logo_file);
|
||||
const result: any = await fetch(`${getAPIUrl()}orgs/` + org_id + "/logo", RequestBodyForm("PUT", formData, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
const formData = new FormData()
|
||||
formData.append('logo_file', logo_file)
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}orgs/` + org_id + '/logo',
|
||||
RequestBodyForm('PUT', formData, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue