Skip to content

Commit 105a774

Browse files
committed
Pxl integration
1 parent 6987eed commit 105a774

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ IDV_DOMAIN=auth.hackclub.com
2727
IDV_CLIENT_ID=changeme
2828
IDV_CLIENT_SECRET=changeme
2929

30+
# PXL_API_KEY=
31+
3032
SENTRY_AUTH_TOKEN=changeme
3133

3234
# AIRTABLE_TOKEN=abcxyz # optional

src/routes/dashboard/admin/ysws-review/[id]/+page.server.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { calculatePayouts } from '$lib/currency';
1313
import { isValidUrl } from '$lib/utils';
1414
import { sanitizeUrl } from '@braintree/sanitize-url';
1515
import { T2_PAYOUT_BRICKS } from '$lib/defs';
16+
import { PXL_API_KEY } from '$env/static/private';
1617

1718
export async function load({ locals, params }) {
1819
if (!locals.user) {
@@ -339,6 +340,16 @@ export const actions = {
339340
})
340341
.where(eq(user.id, queriedProject.user.id));
341342

343+
if (PXL_API_KEY)
344+
await fetch('https://pxl.hackclub.com/api/pixels/give', {
345+
method: 'POST',
346+
headers: {
347+
Authorization: `Bearer ${PXL_API_KEY}`,
348+
'Content-Type': 'application/json'
349+
},
350+
body: JSON.stringify({ slack_id: queriedProject.user.slackId, number_to_add: 200 })
351+
});
352+
342353
const feedbackText = feedback ? `\n\nHere's what they said:\n${feedback}` : '';
343354

344355
await sendSlackDM(

0 commit comments

Comments
 (0)