Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RafidMuhymin committed May 16, 2024
2 parents 527558d + cfbc281 commit 6b82fba
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/D1Strapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default async function D1Strapi(
alternateENV?: typeof env,
): Promise<StrapiCollections> {
if (!strapiCollections) {
const { results } = await ((env || alternateENV).USERS as D1Database)
const { results } = await ({ ...alternateENV, ...env }.USERS as D1Database)
.prepare("SELECT * FROM strapi")
.all();

Expand Down
3 changes: 3 additions & 0 deletions src/workers/dilmahtea-me-baserow/src/types/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export interface ENV {
CROWDFUNDINGS: KVNamespace;
ECOMMERCE_PAYMENTS: KVNamespace;

// D1
USERS: D1Database;

// BASEROW
BASEROW_TOKEN: string;
BASEROW_CROWDFUNDING_TABLE_ID: string;
Expand Down
3 changes: 3 additions & 0 deletions src/workers/dilmahtea-me-email/src/types/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export interface ENV {
// KV NAMESPACES
MAILS: KVNamespace;

// D1
USERS: D1Database;

// SECRETS
CF_SECURE_WORKER_TOKEN: string;
}
3 changes: 3 additions & 0 deletions src/workers/dilmahtea-me-retry-workers/src/types/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export interface ENV {
// KV
WORKER_REQUESTS: KVNamespace;

// D1
USERS: D1Database;

// SERVICES
EMAIL: Fetcher;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default async function sendErrorEmail(
) {
let notifySales, subject, body;

const { recurringElement } = await D1Strapi();
// @ts-ignore
const { recurringElement } = await D1Strapi(env);

const { DEV_EMAIL, SALES_EMAIL } = recurringElement.data.attributes;

Expand Down

0 comments on commit 6b82fba

Please sign in to comment.