Merged in feat/LOY-486-consent-prompt-date (pull request #3221)

Feat/LOY-486 consent prompt date

* chore(LOY-486): update name on date

* chore(LOY-486): open links in new tab

* chore(LOY-486): send prompt date + refactor modal

* chore(LOY-486): update README


Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
Matilda Landström
2025-11-26 12:11:57 +00:00
parent f70c431a5e
commit 086319e8b1
9 changed files with 119 additions and 37 deletions

View File

@@ -12,6 +12,7 @@ import {
addPromoCampaignInput,
deleteCreditCardInput,
profilingConsentInput,
profilingConsentPromptDateInput,
saveCreditCardInput,
signupInput,
} from "./input"
@@ -246,6 +247,35 @@ export const userMutationRouter = router({
return true
}),
}),
profilingConsentPromptDate: router({
update: protectedProcedure
.input(profilingConsentPromptDateInput)
.mutation(async function ({ ctx, input }) {
const profilingConsentPromptDateCounter = createCounter(
"trpc.user",
"profilingConsentPromptDate"
)
const metricsProfilingConsentPromptDate =
profilingConsentPromptDateCounter.init()
const apiResponse = await api.patch(api.endpoints.v2.Profile.profile, {
body: input,
headers: {
Authorization: `Bearer ${ctx.session.token.access_token}`,
},
})
if (!apiResponse.ok) {
await metricsProfilingConsentPromptDate.httpError(apiResponse)
const text = await apiResponse.text()
throw serverErrorByStatus(apiResponse.status, text)
}
metricsProfilingConsentPromptDate.success()
return true
}),
}),
promoCampaign: router({
add: protectedProcedure
.input(addPromoCampaignInput)