Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

689 B
Raw Blame
import {
  UpdateMeResponse,
  UserWithMetaInformation,
} from '@activepieces/shared';

import { api } from '@/lib/api';

export const userApi = {
  getUserById(id: string) {
    return api.get<UserWithMetaInformation>(`/v1/users/${id}`);
  },
  updateMe(profilePicture?: File): Promise<UpdateMeResponse> {
    const formData = new FormData();
    if (profilePicture) {
      formData.append('profilePicture', profilePicture);
    }

    return api.any<UpdateMeResponse>('/v1/users/me', {
      method: 'POST',
      data: formData,
    });
  },
  deleteProfilePicture(): Promise<{ success: boolean }> {
    return api.delete<{ success: boolean }>('/v1/users/me/profile-picture');
  },
};