forked from hiteshchoudhary/chai-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add register controller and bug fixes
- Loading branch information
1 parent
acdad8d
commit 12e4963
Showing
4 changed files
with
85 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import { Router } from "express"; | ||
import { registerUser } from "../controllers/user.controller.js"; | ||
import {upload} from "../middlewares/multer.middleware.js" | ||
|
||
|
||
const router = Router() | ||
|
||
router.route("/register").post(registerUser) | ||
router.route("/register").post( | ||
upload.fields([ | ||
{ | ||
name: "avatar", | ||
maxCount: 1 | ||
}, | ||
{ | ||
name: "coverImage", | ||
maxCount: 1 | ||
} | ||
]), | ||
registerUser | ||
) | ||
|
||
|
||
export default router |
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 |
---|---|---|
|
@@ -5,4 +5,6 @@ class ApiResponse { | |
this.message = message | ||
this.success = statusCode < 400 | ||
} | ||
} | ||
} | ||
|
||
export { ApiResponse } |