diff --git a/apps/dashboard/src/actions/index.ts b/apps/dashboard/src/actions/index.ts index 3534c5200e..6c667dc04d 100644 --- a/apps/dashboard/src/actions/index.ts +++ b/apps/dashboard/src/actions/index.ts @@ -23,6 +23,7 @@ export async function sendFeeback(formData: FormData) { const res = await fetch(`${baseUrl}/email`, { method: "POST", + cache: "no-cache", headers: { Authorization: `Bearer ${env.RESEND_API_KEY}`, "Content-Type": "application/json", @@ -45,6 +46,7 @@ export async function subscribeEmail(formData: FormData, userGroup: string) { const res = await fetch(env.LOOPS_ENDPOINT, { method: "POST", + cache: "no-cache", headers: { "Content-Type": "application/json", }, diff --git a/apps/website/src/actions/subscribeEmail.ts b/apps/website/src/actions/subscribeEmail.ts index 880e79c1a0..8e82e217ef 100644 --- a/apps/website/src/actions/subscribeEmail.ts +++ b/apps/website/src/actions/subscribeEmail.ts @@ -10,6 +10,7 @@ export async function subscribeEmail(formData: FormData, userGroup: string) { const res = await fetch( "https://app.loops.so/api/newsletter-form/clna1p09j00d3l60og56gj3u1", { + cache: "no-cache", method: "POST", headers: { "Content-Type": "application/json", @@ -19,7 +20,7 @@ export async function subscribeEmail(formData: FormData, userGroup: string) { userGroup, country, }), - }, + } ); const json = await res.json(); diff --git a/packages/gocardless/src/index.ts b/packages/gocardless/src/index.ts index 60d9b65c28..b7ad357072 100644 --- a/packages/gocardless/src/index.ts +++ b/packages/gocardless/src/index.ts @@ -21,6 +21,7 @@ const keys = { async function getRefreshToken(refresh: string) { const res = await fetch(`${baseUrl}/api/v2/token/refresh/`, { method: "POST", + cache: "no-cache", headers: { "Content-Type": "application/json", }, @@ -55,6 +56,7 @@ async function getAccessToken() { const res = await fetch(`${baseUrl}/api/v2/token/new/`, { method: "POST", + cache: "no-cache", headers: { "Content-Type": "application/json", }, @@ -86,6 +88,7 @@ export async function getBanks(countryCode: string) { const res = await fetch( `${baseUrl}/api/v2/institutions/?country=${countryCode.toLowerCase()}`, { + cache: "no-cache", method: "GET", headers: { "Content-Type": "application/json", @@ -102,6 +105,7 @@ export async function createEndUserAgreement(institutionId: string) { const res = await fetch(`${baseUrl}/api/v2/agreements/enduser/`, { method: "POST", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -132,6 +136,7 @@ export async function buildLink({ const res = await fetch(`${baseUrl}/api/v2/requisitions/`, { method: "POST", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -152,6 +157,7 @@ export async function getAccountDetails(id: string) { const [account, details] = await Promise.all([ fetch(`${baseUrl}/api/v2/accounts/${id}/`, { method: "GET", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -159,6 +165,7 @@ export async function getAccountDetails(id: string) { }), fetch(`${baseUrl}/api/v2/accounts/${id}/details/`, { method: "GET", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -180,6 +187,7 @@ export async function getAccountBalancesById(id: string) { const account = await fetch(`${baseUrl}/api/v2/accounts/${id}/balances/`, { method: "GET", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -203,6 +211,7 @@ export async function getAccounts({ const res = await fetch(`${baseUrl}/api/v2/requisitions/${accountId}/`, { method: "GET", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -242,6 +251,7 @@ export async function getTransactions(accountId: string) { const result = await fetch( `${baseUrl}/api/v2/accounts/${accountId}/transactions/`, { + cache: "no-cache", method: "GET", headers: { "Content-Type": "application/json", @@ -258,6 +268,7 @@ export async function getRequisitions() { const result = await fetch(`${baseUrl}/api/v2/requisitions/`, { method: "GET", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, @@ -272,6 +283,7 @@ export async function deleteRequisition(id: string) { const result = await fetch(`${baseUrl}/api/v2/requisitions/${id}/`, { method: "DELETE", + cache: "no-cache", headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}`, diff --git a/packages/jobs/src/transactions/initial.ts b/packages/jobs/src/transactions/initial.ts index ba3f85e887..56926dcf3c 100644 --- a/packages/jobs/src/transactions/initial.ts +++ b/packages/jobs/src/transactions/initial.ts @@ -37,7 +37,7 @@ client.defineJob({ .insert( transformTransactions(transactions?.booked, { accountId: recordId, // Bank account record id - teamId: teamId, + teamId, }) ) .select(); diff --git a/packages/jobs/src/transactions/sync.ts b/packages/jobs/src/transactions/sync.ts index a4994c7e4c..4734995db1 100644 --- a/packages/jobs/src/transactions/sync.ts +++ b/packages/jobs/src/transactions/sync.ts @@ -48,7 +48,7 @@ client.defineJob({ }), { onConflict: "internal_id", - ignoreDuplicates: true, + ignoreDuplicates: false, } ) .select(); diff --git a/packages/notification/src/index.ts b/packages/notification/src/index.ts index 6982e776fb..8a168b95a1 100644 --- a/packages/notification/src/index.ts +++ b/packages/notification/src/index.ts @@ -63,6 +63,7 @@ export async function getSubscriberPreferences({ `${API_ENDPOINT}/subscribers/${teamId}_${subscriberId}/preferences`, { method: "GET", + cache: "no-cache", headers: { Authorization: `ApiKey ${process.env.NOVU_API_KEY!}`, }, @@ -91,6 +92,7 @@ export async function updateSubscriberPreference({ `${API_ENDPOINT}/subscribers/${teamId}_${subscriberId}/preferences/${templateId}`, { method: "PATCH", + cache: "no-cache", headers: { Authorization: `ApiKey ${process.env.NOVU_API_KEY!}`, "Content-Type": "application/json",