Skip to content

Commit

Permalink
Send additional headers for big store API
Browse files Browse the repository at this point in the history
  • Loading branch information
navzam committed Jul 14, 2024
1 parent 8410597 commit f728dcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions parentalConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function createRouter(firebaseTokenManager, mailgunClient, config) {
// Save parental consent PDF
let storeResponse;
try {
storeResponse = await uploadParentalConsentPdf(bodyBuffer, firebaseIdToken, config);
storeResponse = await uploadParentalConsentPdf(bodyBuffer, userId, firebaseIdToken, config);
} catch (storeError) {
console.error('Failed to store parental consent PDF', storeError);
res.status(500).send();
Expand Down Expand Up @@ -289,11 +289,15 @@ async function getCurrentConsent(userId, token, config) {
}
}

async function uploadParentalConsentPdf(pdfData, token, config) {
async function uploadParentalConsentPdf(pdfData, userId, token, config) {
const requestConfig = {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/pdf',
'Big-Store-Prefix': 'parental-consent',
'Big-Store-Metadata': JSON.stringify({
userId: userId,
}),
},
};

Expand Down

0 comments on commit f728dcd

Please sign in to comment.