mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 21:24:04 +00:00
fix(review): harden miniapp auth and finance flows
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { BillingPeriod } from '@household/domain'
|
||||
import type { ReminderJobService } from '@household/application'
|
||||
|
||||
const REMINDER_TYPES = ['utilities', 'rent-warning', 'rent-due'] as const
|
||||
type ReminderType = (typeof REMINDER_TYPES)[number]
|
||||
import { BillingPeriod } from '@household/domain'
|
||||
import { REMINDER_TYPES, type ReminderType } from '@household/ports'
|
||||
|
||||
interface ReminderJobRequestBody {
|
||||
period?: string
|
||||
@@ -42,8 +40,11 @@ async function readBody(request: Request): Promise<ReminderJobRequestBody> {
|
||||
return {}
|
||||
}
|
||||
|
||||
const parsed = JSON.parse(text) as ReminderJobRequestBody
|
||||
return parsed
|
||||
try {
|
||||
return JSON.parse(text) as ReminderJobRequestBody
|
||||
} catch {
|
||||
throw new Error('Invalid JSON body')
|
||||
}
|
||||
}
|
||||
|
||||
export function createReminderJobsHandler(options: {
|
||||
|
||||
Reference in New Issue
Block a user