mirror of
https://github.com/Tony0410/quietthanks.git
synced 2026-05-25 05:41:38 +08:00
Implement server-side push notifications with scheduler and always-remind option
This commit is contained in:
@@ -15,6 +15,7 @@ export async function GET() {
|
||||
.select({
|
||||
reminderEnabled: schema.users.reminderEnabled,
|
||||
reminderTime: schema.users.reminderTime,
|
||||
reminderAlways: schema.users.reminderAlways,
|
||||
llmProvider: schema.users.llmProvider,
|
||||
llmApiKey: schema.users.llmApiKey,
|
||||
llmModel: schema.users.llmModel,
|
||||
@@ -30,6 +31,7 @@ export async function GET() {
|
||||
return NextResponse.json({
|
||||
reminderEnabled: users[0].reminderEnabled === 1,
|
||||
reminderTime: users[0].reminderTime || "20:00",
|
||||
reminderAlways: users[0].reminderAlways === 1,
|
||||
llmProvider: users[0].llmProvider || null,
|
||||
hasLlmKey: Boolean(users[0].llmApiKey),
|
||||
llmModel: users[0].llmModel || null,
|
||||
@@ -55,6 +57,10 @@ export async function PATCH(request: NextRequest) {
|
||||
updates.reminderEnabled = body.reminderEnabled ? 1 : 0;
|
||||
}
|
||||
|
||||
if (typeof body.reminderAlways === "boolean") {
|
||||
updates.reminderAlways = body.reminderAlways ? 1 : 0;
|
||||
}
|
||||
|
||||
if (typeof body.reminderTime === "string") {
|
||||
updates.reminderTime = body.reminderTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user