From 77a4fb5df094aa70766c4ba3f8ce61aeed36f2b7 Mon Sep 17 00:00:00 2001 From: Sanjay Soundarajan Date: Fri, 8 Nov 2024 07:56:58 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20remove=20emb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuxt.config.ts | 14 +++++--------- server/api/datasets/[datasetid]/index.get.ts | 20 -------------------- server/api/datasets/index.get.ts | 18 ++---------------- 3 files changed, 7 insertions(+), 45 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index c98de95..1b38feb 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -89,10 +89,6 @@ export default defineNuxtConfig({ position: "bottom-right", }, - overrides: { - vue: "latest", - }, - runtimeConfig: { entraClientSecret: "", public: { @@ -138,11 +134,11 @@ export default defineNuxtConfig({ : process.env.NUXT_SITE_ENV === "staging" ? "https://staging.api.fairhub.io" : "https://api.fairhub.io", - STUDY_RELEASE_TIMESTAMP: - process.env.NUXT_SITE_ENV === "dev" || - process.env.NUXT_SITE_ENV === "staging" - ? "1730950200" // Wed Nov 06 2024 19:30:00 GMT-0800 (Pacific Standard Time) - : "1731060000", // Fri Nov 07 2024 02:00:00 GMT-0800 (Pacific Standard Time) + // STUDY_RELEASE_TIMESTAMP: + // process.env.NUXT_SITE_ENV === "dev" || + // process.env.NUXT_SITE_ENV === "staging" + // ? "1730950200" // Wed Nov 06 2024 19:30:00 GMT-0800 (Pacific Standard Time) + // : "1731060000", // Fri Nov 07 2024 02:00:00 GMT-0800 (Pacific Standard Time) UMAMI_SHARE_URL: process.env.NUXT_SITE_ENV === "dev" || process.env.NUXT_SITE_ENV === "staging" diff --git a/server/api/datasets/[datasetid]/index.get.ts b/server/api/datasets/[datasetid]/index.get.ts index 2a08466..afef6a6 100644 --- a/server/api/datasets/[datasetid]/index.get.ts +++ b/server/api/datasets/[datasetid]/index.get.ts @@ -1,21 +1,6 @@ export default defineEventHandler(async (event) => { - const config = useRuntimeConfig(event); - - /** emb */ - const embTimestamp = new Date( - parseInt(config.public.STUDY_RELEASE_TIMESTAMP) * 1000, - ); - const pastEmb = new Date() > embTimestamp; - const { datasetid } = event.context.params as { datasetid: string }; - if (!pastEmb && datasetid !== "1") { - throw createError({ - statusCode: 404, - statusMessage: "Dataset not found", - }); - } - const publishedDataset = await prisma.published_dataset.findUnique({ where: { id: datasetid, @@ -69,11 +54,6 @@ export default defineEventHandler(async (event) => { }, }); - /** emb */ - if (!pastEmb && relatedDatasets.length > 1) { - relatedDatasets.shift(); - } - const versions: VersionArray = relatedDatasets.map((relatedDataset) => { return { id: Number(relatedDataset.id).toString(), diff --git a/server/api/datasets/index.get.ts b/server/api/datasets/index.get.ts index 06b36d4..024d9e0 100644 --- a/server/api/datasets/index.get.ts +++ b/server/api/datasets/index.get.ts @@ -1,14 +1,6 @@ -export default defineEventHandler(async (event) => { - const config = useRuntimeConfig(event); - - /** emb */ - const embTimestamp = new Date( - parseInt(config.public.STUDY_RELEASE_TIMESTAMP) * 1000, - ); - const pastEmb = new Date() > embTimestamp; - +export default defineEventHandler(async (_event) => { const publishedDatasets = await prisma.published_dataset.findMany({ - distinct: pastEmb ? ["dataset_id"] : undefined, + distinct: ["dataset_id"], orderBy: { created_at: "desc", }, @@ -57,11 +49,5 @@ export default defineEventHandler(async (event) => { datasets.push(item); } - /** emb */ - if (!pastEmb && datasets.length > 1) { - // remove the first dataset from the list - datasets.shift(); - } - return datasets; });