Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make ts not scream
  • Loading branch information
regalijan committed Feb 27, 2024
1 parent 3451f08 commit dc3a35e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions functions/_middleware.ts
Expand Up @@ -342,7 +342,7 @@ async function setTheme(context: RequestContext) {

const cookieList = cookies.split("; ");

const themeCookie = cookieList.find((c) =>
const themeCookie = cookieList.find((c: string) =>
c.startsWith("chakra-ui-color-mode"),
);
const theme = themeCookie?.split("=").at(1);
Expand All @@ -359,5 +359,5 @@ export const onRequest = [
setTheme,
constructHTML,
setBody,
setHeaders
setHeaders,
];
6 changes: 4 additions & 2 deletions functions/api/data-transfers/_middleware.ts
Expand Up @@ -3,13 +3,15 @@ export async function onRequest(context: RequestContext) {

if (!cookies) return await context.next();

const cookieList = cookies.split("; ").map((cookie) => {
const cookieList = cookies.split("; ").map((cookie: string) => {
const [name, value] = cookie.split("=");

return { name, value };
});

const transferId = cookieList.find((cookie) => cookie.name === "__dtid");
const transferId = cookieList.find(
(cookie: { name: string; value: string }) => cookie.name === "__dtid",
);

if (transferId) context.data.data_transfer_id = transferId;

Expand Down

0 comments on commit dc3a35e

Please sign in to comment.