feat: add admin reset subscription quota endpoint and UI
- Add AdminResetQuota service method to reset daily/weekly usage windows - Add POST /api/v1/admin/subscriptions/:id/reset-quota handler and route - Add resetQuota API function in frontend subscriptions client - Add reset quota button, confirmation dialog, and handlers in SubscriptionsView - Add i18n keys for reset quota feature in zh and en locales Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,23 @@ export async function revoke(id: number): Promise<{ message: string }> {
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset daily and/or weekly usage quota for a subscription
|
||||
* @param id - Subscription ID
|
||||
* @param options - Which windows to reset
|
||||
* @returns Updated subscription
|
||||
*/
|
||||
export async function resetQuota(
|
||||
id: number,
|
||||
options: { daily: boolean; weekly: boolean }
|
||||
): Promise<UserSubscription> {
|
||||
const { data } = await apiClient.post<UserSubscription>(
|
||||
`/admin/subscriptions/${id}/reset-quota`,
|
||||
options
|
||||
)
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* List subscriptions by group
|
||||
* @param groupId - Group ID
|
||||
@@ -170,6 +187,7 @@ export const subscriptionsAPI = {
|
||||
bulkAssign,
|
||||
extend,
|
||||
revoke,
|
||||
resetQuota,
|
||||
listByGroup,
|
||||
listByUser
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user