feat: add renew

This commit is contained in:
2025-12-17 12:06:29 +08:00
parent 1a16b0290f
commit dae9a0e55a
4 changed files with 114 additions and 38 deletions

View File

@@ -7,8 +7,8 @@ function normalizeItems(items) {
}
export const TenantService = {
async listTenants({ page, limit, name, sortField, sortOrder } = {}) {
const query = { page, limit, name };
async listTenants({ page, limit, name, code, sortField, sortOrder } = {}) {
const query = { page, limit, name, code };
if (sortField && sortOrder) {
if (sortOrder === 1) query.asc = sortField;
if (sortOrder === -1) query.desc = sortField;
@@ -21,5 +21,11 @@ export const TenantService = {
total: data?.total ?? 0,
items: normalizeItems(data?.items)
};
},
async renewTenantExpire({ tenantID, duration }) {
return requestJson(`/super/v1/tenants/${tenantID}`, {
method: 'PATCH',
body: { duration }
});
}
};