import { IUserView, UpdateUserParams } from "@models/User.model";
import { ApiVoidResult } from "@models/Api.VoidResult.type";
import ApiRequest from "@services/Api.Service";

export const loadUserInfo = async (userId: string): Promise<IUserView> => {
    return ApiRequest.post<IUserView>("users/get", {
        sessionUser: userId,
    });
};

export const updateUserInfo = async (data: UpdateUserParams): Promise<ApiVoidResult> => {
    return ApiRequest.post<ApiVoidResult>("users/update", {
        ...data,
    });
};
