Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

set image on server with changing

  public static async setAvatar(avatar: ImageFile) {
    const userData = await AuthService.getUserData();

    return this.handleRequestData<void>(
      this.post(
        `${ApiUrls.setAvatarImage}/${userData?.id}`,
        this.objectToFormData({
          user_id: userData?.id,
          avatar_url: getFileObjectForImage(avatar),
        }),
        { headers: FORM_DATA_HEADER },
      ),
    );
  }
 
PREVIOUS NEXT
Tagged: #set #image #server #changing
ADD COMMENT
Topic
Name
3+6 =