Skip to content

Commit

Permalink
🐛 fix: remove emb
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay committed Nov 8, 2024
1 parent 9f89ccc commit 77a4fb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 45 deletions.
14 changes: 5 additions & 9 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export default defineNuxtConfig({
position: "bottom-right",
},

overrides: {
vue: "latest",
},

runtimeConfig: {
entraClientSecret: "",
public: {
Expand Down Expand Up @@ -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"
Expand Down
20 changes: 0 additions & 20 deletions server/api/datasets/[datasetid]/index.get.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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(),
Expand Down
18 changes: 2 additions & 16 deletions server/api/datasets/index.get.ts
Original file line number Diff line number Diff line change
@@ -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",
},
Expand Down Expand Up @@ -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;
});

0 comments on commit 77a4fb5

Please sign in to comment.