feat: extend superadmin navigation

This commit is contained in:
2026-01-14 16:25:18 +08:00
parent 820ee5ba10
commit 788ba4c53a
21 changed files with 248 additions and 330 deletions

View File

@@ -67,23 +67,7 @@ export const ContentService = {
items: normalizeItems(data?.items)
};
},
async listTenantContents(
tenantID,
{
page,
limit,
keyword,
status,
visibility,
user_id,
published_at_from,
published_at_to,
created_at_from,
created_at_to,
sortField,
sortOrder
} = {}
) {
async listTenantContents(tenantID, { page, limit, keyword, status, visibility, user_id, published_at_from, published_at_to, created_at_from, created_at_to, sortField, sortOrder } = {}) {
if (!tenantID) throw new Error('tenantID is required');
const iso = (d) => {
@@ -117,8 +101,7 @@ export const ContentService = {
total: data?.total ?? 0,
items: normalizeItems(data?.items)
};
}
,
},
async updateTenantContentStatus(tenantID, contentID, { status } = {}) {
if (!tenantID) throw new Error('tenantID is required');
if (!contentID) throw new Error('contentID is required');

View File

@@ -7,21 +7,7 @@ function normalizeItems(items) {
}
export const TenantService = {
async listTenants({
page,
limit,
id,
user_id,
name,
code,
status,
expired_at_from,
expired_at_to,
created_at_from,
created_at_to,
sortField,
sortOrder
} = {}) {
async listTenants({ page, limit, id, user_id, name, code, status, expired_at_from, expired_at_to, created_at_from, created_at_to, sortField, sortOrder } = {}) {
const iso = (d) => {
if (!d) return undefined;
const date = d instanceof Date ? d : new Date(d);

View File

@@ -7,21 +7,7 @@ function normalizeItems(items) {
}
export const UserService = {
async listUsers({
page,
limit,
id,
tenant_id,
username,
status,
role,
created_at_from,
created_at_to,
verified_at_from,
verified_at_to,
sortField,
sortOrder
} = {}) {
async listUsers({ page, limit, id, tenant_id, username, status, role, created_at_from, created_at_to, verified_at_from, verified_at_to, sortField, sortOrder } = {}) {
const iso = (d) => {
if (!d) return undefined;
const date = d instanceof Date ? d : new Date(d);
@@ -98,10 +84,7 @@ export const UserService = {
if (!userID) throw new Error('userID is required');
return requestJson(`/super/v1/users/${userID}`);
},
async listUserTenants(
userID,
{ page, limit, tenant_id, code, name, role, status, created_at_from, created_at_to } = {}
) {
async listUserTenants(userID, { page, limit, tenant_id, code, name, role, status, created_at_from, created_at_to } = {}) {
if (!userID) throw new Error('userID is required');
const iso = (d) => {

View File

@@ -39,4 +39,3 @@ export async function refreshSuperToken() {
if (token) setSuperAuthToken(token);
return token;
}