feat: p2 batch 28-31 reminders lists comments bang stats
Calendar events support multiple reminder offsets with presets and per-user defaults. Lists index adds inline task entry and list property editing. Generic entity comments on list detail. New bangs.stats dashboard widget. Closes Gitea #28, #29, #30, #31. Migrations 0022 and 0023.
This commit is contained in:
@@ -59,16 +59,20 @@ export async function updateListForScope(
|
||||
.update(lists)
|
||||
.set({
|
||||
name: parsed.name,
|
||||
type: parsed.type,
|
||||
archived: parsed.archived,
|
||||
})
|
||||
.where(eq(lists.id, parsed.id));
|
||||
|
||||
if (parsed.name) {
|
||||
if (parsed.name || parsed.type) {
|
||||
await logActivityForScope(toScope(scope), {
|
||||
entityType: "lists.list",
|
||||
entityId: parsed.id,
|
||||
action: "update",
|
||||
payload: { name: parsed.name },
|
||||
payload: {
|
||||
...(parsed.name ? { name: parsed.name } : {}),
|
||||
...(parsed.type ? { type: parsed.type } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
if (parsed.archived === true) {
|
||||
@@ -93,6 +97,20 @@ export async function renameList(input: { id: string; name: string }) {
|
||||
revalidatePath(`/lists/${parsed.id}`);
|
||||
}
|
||||
|
||||
export async function updateListProperties(input: { id: string; name?: string; type?: string }) {
|
||||
const parsed = z
|
||||
.object({
|
||||
id: z.string().uuid(),
|
||||
name: listInput.shape.name.optional(),
|
||||
type: listInput.shape.type.optional(),
|
||||
})
|
||||
.parse(input);
|
||||
const { household, user } = await getCurrentSession();
|
||||
await updateListForScope({ householdId: household.id, userId: user.id, role: null }, parsed);
|
||||
revalidatePath("/lists");
|
||||
revalidatePath(`/lists/${parsed.id}`);
|
||||
}
|
||||
|
||||
export async function archiveList(input: { id: string }) {
|
||||
const parsed = z.object({ id: z.string().uuid() }).parse(input);
|
||||
const { household, user } = await getCurrentSession();
|
||||
|
||||
Reference in New Issue
Block a user