UNPKG

@bit-ui-libs/common

Version:
22 lines (18 loc) 962 B
import { BaseServiceOptions } from '../../api/services/base-service'; import { ProfileTypeEnum } from '../enums'; import { CreatorProfile } from '../interfaces'; import { ProfileService } from './profile.service'; import { AddProfileRequest, EditProfileRequest } from './profile.service.interfaces'; export type EditCreatorProfileRequest = EditProfileRequest & Partial<CreatorProfile>; export type AddCreatorProfileRequest = AddProfileRequest & Partial<CreatorProfile>; export class CreatorProfileService extends ProfileService<CreatorProfile> { constructor(opts: BaseServiceOptions) { super({ ...opts, profileType: ProfileTypeEnum.Creator }); } editProfile(id: string, req: EditCreatorProfileRequest) { return this.put<CreatorProfile, EditCreatorProfileRequest>(`${this.profileApiUrl}/${id}`, req); } addProfile(req: AddCreatorProfileRequest) { return this.post<CreatorProfile, AddCreatorProfileRequest>(this.profileApiUrl, req); } }