优化
This commit is contained in:
@@ -281,10 +281,11 @@ describe('platform IAM roles', () => {
|
||||
establishedDate: '2020-01-01', registeredCapital: 1000, registeredCapitalCurrency: 'CNY',
|
||||
registeredAddress: '深圳市宝安区', internalRemark: '重点客户',
|
||||
}
|
||||
vi.mocked(http.post).mockResolvedValue({ code: '200', message: 'success', data: tenant })
|
||||
const creation = { tenant, administratorUsername: '13800138000', temporaryPassword: 'Password1234' }
|
||||
vi.mocked(http.post).mockResolvedValue({ code: '200', message: 'success', data: creation })
|
||||
vi.mocked(http.put).mockResolvedValue({ code: '200', message: 'success', data: tenant })
|
||||
|
||||
await expect(createPlatformTenant(create)).resolves.toEqual(tenant)
|
||||
await expect(createPlatformTenant(create)).resolves.toEqual(creation)
|
||||
await expect(updatePlatformTenant('8', create)).resolves.toEqual(tenant)
|
||||
await expect(changePlatformTenantStatus('8', 'DISABLED')).resolves.toEqual(tenant)
|
||||
|
||||
|
||||
@@ -141,6 +141,12 @@ export interface EnterpriseApprovalResponse {
|
||||
temporaryPassword: string | null
|
||||
}
|
||||
|
||||
export interface PlatformTenantCreationResponse {
|
||||
tenant: PlatformTenantResource
|
||||
administratorUsername: string
|
||||
temporaryPassword: string
|
||||
}
|
||||
|
||||
export interface ResetPlatformTenantOwnerPasswordRequest {
|
||||
newPassword: string
|
||||
forceChangePassword: boolean
|
||||
@@ -350,7 +356,7 @@ export async function checkPlatformTenantContactPhone(contactPhone: string, excl
|
||||
}
|
||||
|
||||
export function createPlatformTenant(payload: CreatePlatformTenantRequest) {
|
||||
return postData<PlatformTenantResource>('/platform/v1/iam/tenants', payload)
|
||||
return postData<PlatformTenantCreationResponse>('/platform/v1/iam/tenants', payload)
|
||||
}
|
||||
|
||||
export function updatePlatformTenant(tenantId: number | string, payload: UpdatePlatformTenantRequest) {
|
||||
|
||||
Reference in New Issue
Block a user