feat: add sorting and pinning functionality for accounts and sites
- Introduced `isPinned` and `sortOrder` fields in the `accounts` and `sites` tables to allow users to pin and sort their accounts and sites. - Updated API routes to handle pinning and sorting operations for accounts and sites. - Enhanced the frontend to support sorting by balance and custom order, as well as toggling the pin status of accounts and sites. - Added tests for sorting and reordering logic to ensure correct functionality. - Updated documentation to reflect changes in token management and new features.
This commit is contained in:
@@ -5,7 +5,7 @@ const VERSION = 'v1';
|
||||
const ALGORITHM = 'aes-256-gcm';
|
||||
|
||||
function buildKey(): Buffer {
|
||||
const secret = (config.accountCredentialSecret || '').trim() || config.authToken || 'change-me';
|
||||
const secret = (config.accountCredentialSecret || '').trim() || config.authToken || 'change-me-admin-token';
|
||||
return createHash('sha256').update(secret).digest();
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,8 @@ function buildAccountsSectionFromRefBackup(data: RawBackupData): AccountsBackupS
|
||||
url: siteUrl,
|
||||
platform,
|
||||
status: 'active',
|
||||
isPinned: false,
|
||||
sortOrder: sites.length,
|
||||
apiKey: null,
|
||||
createdAt: toIsoString(item.created_at),
|
||||
updatedAt: toIsoString(item.updated_at),
|
||||
@@ -213,6 +215,8 @@ function buildAccountsSectionFromRefBackup(data: RawBackupData): AccountsBackupS
|
||||
unitCost: null,
|
||||
valueScore: 0,
|
||||
status: asBoolean(item.disabled, false) ? 'disabled' : 'active',
|
||||
isPinned: false,
|
||||
sortOrder: accounts.length,
|
||||
checkinEnabled: asBoolean(checkin.autoCheckInEnabled, true),
|
||||
lastCheckinAt: null,
|
||||
lastBalanceRefresh: null,
|
||||
|
||||
Reference in New Issue
Block a user