Menu

Our delete route touches seven tables, our export route reads five, and the two it misses hold the only free text we have
📰

Our delete route touches seven tables, our export route reads five, and the two it misses hold the only free text we have

DEV Community: nextjs·Daniel Pertu·about 22 hours ago
#vk94t5fC
#devtonextjs#devto#dev#export#delete
Reading 0:00
15s threshold

Munchable is a barcode scanner for people with gut conditions, and the thing that makes its privacy notice short is that the health data never arrives: the conditions you pick, your sensitivities and your scan history are on the phone, and the verdict is worked out there too. The policy is at munchable.app/privacy , and the sentence it leads with is that we hold an email address, a subscription record and any labels you contributed.

Two route handlers have to make that sentence checkable: one that hands you everything we hold, and one that erases it. They live in sibling folders, they were written months apart, and they disagree about the schema.

The export, in full

GET /api/export-account is five queries in parallel and one JSON response.

const [ ent , consent , rewards , contributions , feedback ] = await Promise . all ( [ db . select ( ) . from ( entitlements ) . where ( eq ( entitlements . userId , uid ) ) . limit ( 1 ) , db . select ( ) . from ( userConsent ) . where ( eq ( userConsent .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.