Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic CMS based market metadata #2020

Merged
merged 46 commits into from
Jan 10, 2024
Merged

Dynamic CMS based market metadata #2020

merged 46 commits into from
Jan 10, 2024

Conversation

yornaath
Copy link
Contributor

@yornaath yornaath commented Nov 28, 2023

  • Implement sanity for market metadata.
  • Override market question, image and description with CMS
  • Set a polkasembly referendum index in CMS metadata for a market.
  • Use a fallback image for markets(without cms image) based on category and market id.

Fixes #2006
Fixes #2005
Fixes #1452
Fixes #2006

@yornaath yornaath self-assigned this Nov 28, 2023
Copy link

vercel bot commented Nov 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2024 0:19am

import { getCmsMarketMetadataForMarket } from "lib/cms/get-market-metadata";
import { NextApiRequest, NextApiResponse, PageConfig } from "next";

export const config: PageConfig = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you verify that this works? I think the function signature is a little different for edge: https://vercel.com/docs/functions/edge-functions/edge-functions-api#edge-functions-signature

Would also be good to change the other serverless function in this pr too, probably that one is more important too

@@ -0,0 +1,14 @@
import { createClient, type ClientConfig } from "@sanity/client";

const PROJECT_ID = "4wbnjof1"; // TODO: move to env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be done?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in env on latest commit, but its pretty static, didnt change when I migrated the project over to another org.

@yornaath yornaath merged commit 3720d82 into staging Jan 10, 2024
@yornaath yornaath deleted the tr-cms-maret-metadata branch January 10, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CMS] Attached image to market [CMS] Attach referendumIndex to market Market images via CMS
2 participants