Skip to content

Commit

Permalink
Move UUID to end of join record key (#137)
Browse files Browse the repository at this point in the history
* Move UUID to end of join record key

* v2 -> v3

* Remove extra slash

* Update sample data
  • Loading branch information
WillNilges authored Nov 29, 2024
1 parent de04e79 commit 53a7cba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/JoinForm/JoinForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default function JoinForm() {
let record: JoinRecord = Object.assign(
structuredClone(joinFormSubmission),
{
version: 2,
version: 3,
uuid: self.crypto.randomUUID(),
submission_time: new Date().toISOString(),
code: null,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/join_record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class JoinRecordS3 {
// - dev vs prod join record
// - pre vs post-join form submission
// - 2nd quartet of join record UUID (random but not too long)
const key = `${this.PREFIX}${preSubmission ? "/pre" : "/post"}/${joinRecord.uuid.split("-")[1]}/${submissionKey}.json`;
const key = `${this.PREFIX}/v3/${preSubmission ? "pre" : "post"}/${submissionKey}/${joinRecord.uuid.split("-")[1]}.json`;

let body = JSON.stringify(joinRecord);

Expand Down
2 changes: 1 addition & 1 deletion tests/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const sampleJoinRecord: JoinRecord = {
referral: "Mock Sample Data",
ncl: true,
trust_me_bro: false,
version: 2,
version: 3,
uuid: "1a55b949-0490-4b78-a2e8-10aea41d6f1d",
submission_time: "2024-11-01T08:24:24",
code: 201,
Expand Down

0 comments on commit 53a7cba

Please sign in to comment.