-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement sync with GitHub Sync button (#141)
* feat: added API endpoint for sync * feat: implement synchronization logic * feat: profile supports sync with github action
- Loading branch information
Showing
5 changed files
with
158 additions
and
36 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
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,19 @@ | ||
import { syncWithGithub } from '@/server/controllers/contributors'; | ||
import connectDB from '@/server/db/connectDB'; | ||
import { NextApiHandler } from 'next'; | ||
|
||
// end-point: origin/api/v1/contributors/sync/:contId | ||
const handler: NextApiHandler = async (req, res) => { | ||
console.log('Hii'); | ||
|
||
const { method } = req; | ||
if (method === 'PATCH') { | ||
// handle post request | ||
return syncWithGithub(req, res); | ||
} else { | ||
// error no supported method | ||
res.status(405).json({ message: `method is not supported` }); | ||
} | ||
}; | ||
|
||
export default connectDB(handler); |
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
211b940
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:
gitopener-vercel-app – ./
gitopener.vercel.app
gitopener-vercel-app-git-opener-team.vercel.app
gitopener-vercel-app-git-main-git-opener-team.vercel.app