Skip to content

Commit

Permalink
Merge pull request #138 from IntersectMBO/fix/auth-token-for-upload-p…
Browse files Browse the repository at this point in the history
…hoto

fix: Add auth token for upload token
  • Loading branch information
Kristina2103 authored Jun 24, 2024
2 parents e6a4d09 + 5e84bc2 commit e7ef953
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,16 @@ export async function uploadConstitution(data: FormData) {
}

export async function uploadUserPhoto(userId: string, data: FormData) {
const token = getAccessToken();
try {
const response = await axiosInstance.patch(
`/api/users/${userId}/profile-photo`,
data
data,
{
headers: {
Authorization: `Bearer ${token}`,
},
}
);
return response.data;
} catch (error) {
Expand Down

0 comments on commit e7ef953

Please sign in to comment.