Commit 8749e7a0 authored by Grant's avatar Grant
Browse files

update meta

parent ad2fafd2
Loading
Loading
Loading
Loading
Loading
+69 −1
Original line number Diff line number Diff line
@@ -6,7 +6,11 @@ import { Event } from "./controller/Event";
import { DemoDataManager } from "./demo-data/DemoDataManager";
import cors from "cors";
import { prisma } from "./providers/PrismaProvider";
import type { Event as DBEvent } from "./generated/prisma";
import type {
  Event as DBEvent,
  EventLogo as DBEventLogo,
  EventSocial as DBEventSocial,
} from "./generated/prisma";
import type { InputJsonValue } from "@prisma/client/runtime/library";

if (process.env.DEMO_MODE) {
@@ -55,6 +59,70 @@ app.get("/_internal/sync", async (req, res) => {
    update: event_2025,
  });

  const event_2025_socials: Omit<DBEventSocial, "createdAt" | "updatedAt">[] = [
    {
      id: "CANVAS-2025-lemmy",
      icon: "lemmy",
      label: "Community",
      url: "https://toast.ooo/c/canvas",
      order: 0,
      eventId: "CANVAS-2025",
    },
    {
      id: "CANVAS-2025-mastodon",
      icon: "mastodon",
      label: "Microblog",
      url: "https://social.fediverse.events/@canvas",
      order: 1,
      eventId: "CANVAS-2025",
    },
    {
      id: "CANVAS-2025-matrix",
      icon: "matrix",
      label: "Matrix",
      url: "https://matrix.to/#/#canvas:aftermath.gg?via=matrix.org",
      order: 2,
      eventId: "CANVAS-2025",
    },
    {
      id: "CANVAS-2025-discord",
      icon: "discord",
      label: "Discord",
      url: "https://discord.gg/XrDSJ2WJqa",
      order: 3,
      eventId: "CANVAS-2025",
    },
  ];

  for (const social of event_2025_socials) {
    await prisma.eventSocial.upsert({
      where: {
        id: social.id,
      },
      create: social,
      update: social,
    });
  }

  const event_2025_logos: Omit<DBEventLogo, "createdAt" | "updatedAt">[] = [
    {
      id: "CANVAS-2025-main",
      url: "https://cdn.sc07.company/logos/canvas/logo.png",
      mime: "image/png",
      priority: 1,
      size: "s512x512",
      eventId: "CANVAS-2025",
    },
  ];

  for (const logo of event_2025_logos) {
    await prisma.eventLogo.upsert({
      where: { id: logo.id },
      create: logo,
      update: logo,
    });
  }

  res.send("ok");
});