mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-11 08:19:16 +00:00
feat: add ability to upload a profile picture (#244)
This commit is contained in:
@@ -39,6 +39,20 @@ export default class UserService extends APIService {
|
||||
await this.api.delete(`/users/${id}`);
|
||||
}
|
||||
|
||||
async updateProfilePicture(userId: string, image: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', image!);
|
||||
|
||||
await this.api.put(`/users/${userId}/profile-picture`, formData);
|
||||
}
|
||||
|
||||
async updateCurrentUsersProfilePicture(image: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', image!);
|
||||
|
||||
await this.api.put('/users/me/profile-picture', formData);
|
||||
}
|
||||
|
||||
async createOneTimeAccessToken(userId: string, expiresAt: Date) {
|
||||
const res = await this.api.post(`/users/${userId}/one-time-access-token`, {
|
||||
userId,
|
||||
|
||||
Reference in New Issue
Block a user