Merge branch 'dev_new_ljy' into dev
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
import { PartnerStaffRole, type CreatePartnerStaffRequest, type PartnerStaffItem, type UpdatePartnerStaffRequest } from '@dukang/shared-types';
|
||||
import type { CreatePartnerStaffRequest, PartnerStaffItem, UpdatePartnerStaffRequest } from '@dukang/shared-types';
|
||||
import { request } from './api';
|
||||
|
||||
/** 兼容尚未部署新后端的线上 API(仍校验 staffRole/code) */
|
||||
function toCreateStaffPayload(body: CreatePartnerStaffRequest) {
|
||||
return {
|
||||
name: body.name,
|
||||
phone: body.phone,
|
||||
staffRole: PartnerStaffRole.INTERNAL,
|
||||
code: '123456',
|
||||
};
|
||||
}
|
||||
|
||||
export function listPartnerStaff() {
|
||||
return request<PartnerStaffItem[]>('PARTNER_H5', '/partner/staff');
|
||||
}
|
||||
@@ -18,7 +8,7 @@ export function listPartnerStaff() {
|
||||
export function createPartnerStaff(body: CreatePartnerStaffRequest) {
|
||||
return request<PartnerStaffItem>('PARTNER_H5', '/partner/staff', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(toCreateStaffPayload(body)),
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user