Skip to content

Conversation

swand0g
Copy link
Contributor

@swand0g swand0g commented Jun 21, 2022

thinking of doing something liek this to simplify our API cause its kinda confusing

  • api/teams/[team]/projects/[project]/repos/[repo] 👉
    /api/repos/[repoName]?team=[teamName]&project=[projectName]

im thinking this will simplify stuff, also easier to navigate the files, and all "repo related functionality" can live within /api/repos/[repo]

mainly having an api file named index.ts (for which we already have a bunch) and having to navigate down a tree of like 5 folders seems like much

import type { NextApiRequest, NextApiResponse } from 'next'

export default async function repoAPI(req: NextApiRequest, res: NextApiResponse) {
const { repoName, team, project }: any = req.query
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const { repoName, team, project }: any = req.query
const { repoName, team, project } : any = req.query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants