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

refactor(api): repos and teams APIs #105

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

refactor(api): repos and teams APIs #105

wants to merge 3 commits into from

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