Update Supabase dependency, delete cookie handling, create logger

Updated Supabase dependency across multiple packages from "^2.41.1" to "^2.42.0". Removed files handling sidebar state and theme cookies. Created a new Logger interface for managing log messages in the shared package. Enhanced the middleware to track accounts membership webhook payload. Minor adjustments were also made in multiple package.json files.
This commit is contained in:
giancarlo
2024-04-03 23:59:41 +08:00
parent 406739d96d
commit 35ef90b4f8
23 changed files with 1019 additions and 1027 deletions

View File

@@ -77,7 +77,9 @@ export class WordpressClient implements CmsClient {
const urls = endpoints.map((endpoint) => `${this.apiUrl}${endpoint}`);
const responses = await Promise.all(
urls.map((url) => fetch(url).then((value) => value.json())),
urls.map((url) =>
fetch(url).then((value) => value.json() as Promise<WP_REST_API_Post[]>),
),
).then((values) => values.flat().filter(Boolean));
return await Promise.all(
@@ -130,14 +132,16 @@ export class WordpressClient implements CmsClient {
];
const promises = endpoints.map((endpoint) =>
fetch(this.apiUrl + endpoint).then((res) => res.json()),
fetch(this.apiUrl + endpoint).then(
(res) => res.json() as Promise<WP_REST_API_Post[]>,
),
);
const responses = await Promise.all(promises).then((values) =>
values.filter(Boolean),
);
const item = responses[0][0] as WP_REST_API_Post;
const item = responses[0] ? responses[0][0] : undefined;
if (!item) {
return;