Admin: News je Projekt aktivieren und abschalten
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a421308019
commit
6dac6aa073
6 files changed
+361
-9
No files matched your search
@@ -223,8 +223,8 @@ function byNote(by, verb) {
|
||||
return by ? `${verb} von ${by}`.slice(0, 300) : undefined
|
||||
}
|
||||
|
||||
export async function activate(docId, { by } = {}) {
|
||||
const note = byNote(by, 'Freigeschaltet')
|
||||
export async function activate(docId, { by, adminNote } = {}) {
|
||||
const note = adminNote ?? byNote(by, 'Freigeschaltet')
|
||||
return updateDocument(config.collections.portalFeatures, docId, {
|
||||
...stateFields('active'),
|
||||
activatedAt: new Date().toISOString(),
|
||||
@@ -232,8 +232,8 @@ export async function activate(docId, { by } = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function disable(docId, { by } = {}) {
|
||||
const note = byNote(by, 'Abgeschaltet')
|
||||
export async function disable(docId, { by, adminNote } = {}) {
|
||||
const note = adminNote ?? byNote(by, 'Abgeschaltet')
|
||||
return updateDocument(config.collections.portalFeatures, docId, {
|
||||
...stateFields('disabled'),
|
||||
disabledAt: new Date().toISOString(),
|
||||
@@ -242,11 +242,11 @@ export async function disable(docId, { by } = {}) {
|
||||
}
|
||||
|
||||
/** Freischaltung ohne Zahlung und ohne Ticket (unlockedByPurchase bleibt false). */
|
||||
export async function adminActivate(customerId, projectId, key, { by } = {}) {
|
||||
export async function adminActivate(customerId, projectId, key, { by, adminNote } = {}) {
|
||||
assertKey(key)
|
||||
await assertOwnProject(customerId, projectId)
|
||||
const doc = await ensureFeatureDoc(customerId, projectId, key)
|
||||
return activate(doc.$id, { by })
|
||||
return activate(doc.$id, { by, adminNote })
|
||||
}
|
||||
|
||||
/** Alle 'setup'-Funktionen (optional nur eines Kunden), deren Ticket 'Closed' ist, werden 'active'. */
|
||||
|
||||
Reference in new issue
Block a user