-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
static props is backup for dashboard (#2042)
- Loading branch information
Showing
6 changed files
with
106 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
createSupabaseClient, | ||
createSupabaseDirectClient, | ||
} from 'shared/supabase/init' | ||
import { z } from 'zod' | ||
import { MaybeAuthedEndpoint, authEndpoint, validate } from './helpers' | ||
import { run } from 'common/supabase/utils' | ||
|
||
const bodySchema = z.object({ | ||
dashboardSlug: z.string(), | ||
}) | ||
|
||
export const getdashboardfromslug = MaybeAuthedEndpoint(async (req) => { | ||
const { dashboardSlug } = validate(bodySchema, req.body) | ||
const db = createSupabaseClient() | ||
const { data } = await run( | ||
db.from('dashboards').select('*').eq('slug', dashboardSlug).limit(1) | ||
) | ||
|
||
if (data && data.length > 0) { | ||
return { dashboard: data[0] } | ||
} | ||
return { dashboard: null } | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ad0277c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./docs
docs-git-main-mantic.vercel.app
docs-pi-teal.vercel.app
docs.manifold.markets
docs-mantic.vercel.app
ad0277c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
prod – ./web
mantic.vercel.app
prod-git-main-mantic.vercel.app
prod-mantic.vercel.app
manifold.markets
www.manifold.markets