@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
22 lines (18 loc) • 962 B
text/typescript
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);
}
}