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,16 +1,27 @@
|
|||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody, RequestBodyForm, errorHandling, getResponseMetadata } from "@services/utils/ts/requests";
|
||||
import { getAPIUrl } from '@services/config/config'
|
||||
import {
|
||||
RequestBody,
|
||||
RequestBodyForm,
|
||||
errorHandling,
|
||||
getResponseMetadata,
|
||||
} from '@services/utils/ts/requests'
|
||||
|
||||
export async function getUser(user_id: string) {
|
||||
const result = await fetch(`${getAPIUrl()}users/user_id/${user_id}`, RequestBody("GET", null, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}users/user_id/${user_id}`,
|
||||
RequestBody('GET', null, null)
|
||||
)
|
||||
const res = await errorHandling(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function updateUserAvatar(user_uuid: any, avatar_file: any) {
|
||||
const formData = new FormData();
|
||||
formData.append("avatar_file", avatar_file);
|
||||
const result: any = await fetch(`${getAPIUrl()}users/update_avatar/${user_uuid}`, RequestBodyForm("PUT", formData, null));
|
||||
const res = await getResponseMetadata(result);
|
||||
return res;
|
||||
}
|
||||
const formData = new FormData()
|
||||
formData.append('avatar_file', avatar_file)
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}users/update_avatar/${user_uuid}`,
|
||||
RequestBodyForm('PUT', formData, null)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue