Include card id in initial kv value

This commit is contained in:
Regalijan 2023-11-15 20:46:04 -05:00
parent 4649b725a1
commit ffe4c7962c
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -72,9 +72,12 @@ export async function onRequestPost(context: RequestContext) {
if (!createCardReq.ok) return jsonError("Failed to create entry", 500); if (!createCardReq.ok) return jsonError("Failed to create entry", 500);
const { id: cardId }: { id: string } = await createCardReq.json();
await context.env.DATA.put( await context.env.DATA.put(
`datatransfer_${id}`, `datatransfer_${id}`,
JSON.stringify({ JSON.stringify({
cardId,
oldUser: authedUser, oldUser: authedUser,
}), }),
{ {