Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/routes/dashboard/admin/ysws-review/[id]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ export const actions = {
]);
}

if (env.PXL_API_KEY)
if (env.PXL_API_KEY) {
// typescript can't do basic maths and concatenates two items of
// type number together so we multiply by 1
const number_to_add = queriedProject.timeSpent * 1 + 200 * 1;

await fetch('https://pxl.hackclub.com/api/pixels/give', {
method: 'POST',
headers: {
Expand All @@ -302,9 +306,10 @@ export const actions = {
},
body: JSON.stringify({
email: primary_email,
number_to_add: 200 + queriedProject.timeSpent
number_to_add
})
});
}
}

await db.insert(t2Review).values({
Expand Down
Loading