Commit db614085 authored by Grant's avatar Grant
Browse files

fix wording in eventinto & add api utility to sync date

parent 0c5d8cdb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ export const EventInfoModal = () => {
              <h1 className="text-3xl text-center font-bold">
                {date.start ? <TimeUntil start={date.start} /> : "..."}
              </h1>
              <h2 className="text-2xl text-center">Canvas 2026</h2>
              <h2 className="text-2xl text-center">until Canvas 2026</h2>
              <p>
                Canvas is a collaborative pixel canvas that runs every year for{" "}
                <Link href="https://fediverse.info/" target="_blank">
+17 −0
Original line number Diff line number Diff line
@@ -13,6 +13,23 @@ export const API = {
        }),
    },
  },
  macro: {
    syncEventFromFEAPI: (event_id: string) =>
      fetch("https://api.fediverse.events/v1/events/" + event_id)
        .then((req) => {
          if (!req.ok)
            throw new Error(
              "fediverse.events api returned not ok " + req.status,
            );
          return req.json();
        })
        .then((eventData) =>
          API.admin.config.update("event.dates", {
            start: new Date(eventData.start).getTime(),
            end: new Date(eventData.end).getTime(),
          }),
        ),
  },
};

// @ts-expect-error