Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions routers/sing-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ router.post("/register/email", async (req, res) => {
if(req.body.password === "" || req.confirm_password === "") {
return res.status(400).send({
success: false,
message: "Please enter your password"
message: "Please enter your password."
});
}
if (req.body.password !== req.body.confirm_password) {
Expand Down Expand Up @@ -57,7 +57,7 @@ router.post("/register/email", async (req, res) => {

return res.status(200).send({
success: true,
message: "An Email sent to your account please verify",
message: "An Email sent to your account please verify.",

})
//new
Expand Down Expand Up @@ -102,7 +102,7 @@ router.post("/register/email/checkOTP", async (req, res) => {

return res.status(200).send({
success: true,
message: "Email verified sucessfully",
message: "Email verified sucessfully.",

})
} catch (e) {
Expand All @@ -120,13 +120,13 @@ router.post('/login',async (req, res) => {
if (!user) {
return res.status(401).send({
success: false,
message: "No account associated with the email address"
message: "No account associated with the email address."
})
}
if (!user.verified) {
return res.status(401).send({
success: false,
message: "Verify email againt"
message: "Verify email againt."
})
}
// Incorrect password
Expand Down Expand Up @@ -210,7 +210,7 @@ router.post('/forgotpassword',async (req,res) => {

return res.status(200).send({
success: true,
message: "An Email sent to your account please verify your identity",
message: "An Email sent to your account please verify your identity.",

})

Expand Down Expand Up @@ -244,7 +244,7 @@ router.post("/forgotpassword/checkOTP", async (req, res) => {

return res.status(200).send({
success: true,
message: "Verify your identity sucessfully",
message: "Verify your identity sucessfully.",

})
};
Expand All @@ -269,7 +269,7 @@ router.post("/forgotpassword/resetpassword",async(req,res) => {
});
if(req.body.password === "" || req.confirm_password === "") return res.status(400).send({
success: false,
message: "Please enter your password"
message: "Please enter your password."
});

if (req.body.password !== req.body.confirm_password) return res.status(400).send({
Expand All @@ -281,7 +281,7 @@ router.post("/forgotpassword/resetpassword",async(req,res) => {

return res.status(200).send({
success: true,
message: "Reset password sucessfully",
message: "Reset password sucessfully.",

})

Expand Down Expand Up @@ -312,7 +312,7 @@ router.post("/changepassword" ,passport.authenticate('jwt', { session: false }),

return res.status(200).send({
success: true,
message: "Change password sucessfully"
message: "Change password sucessfully."

});
} catch (e) {
Expand Down Expand Up @@ -341,7 +341,7 @@ router.post("/newotp/verify/email",async(req,res) => {

return res.status(200).send({
success: true,
message: "An Email sent to your account please verify email"
message: "An Email sent to your account please verify email."

});
} catch (e) {
Expand All @@ -368,7 +368,7 @@ router.post("/newotp/verify/forgotpassword",async(req,res) => {

return res.status(200).send({
success: true,
message: "An Email sent to your account please verify email"
message: "An Email sent to your account please verify email."

});
} catch (e) {
Expand Down
5 changes: 3 additions & 2 deletions routers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ router.delete("/unfollow_topic/:topic_id", async (request, response) => {
}
});

router.get("/user_like_post", async (request, response) => {
router.post("/user_like_post", async (request, response) => {
// #swagger.tags = ['User']
// #swagger.description = 'ขอ post ที่ user like ไว้'
try {

const like_post = await likepostModel.find({user_id : request.user.id});
//console.log(like_post);


const res = []
for(i=0 ;i<like_post.length;i++){
Expand Down
32 changes: 28 additions & 4 deletions swagger_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@
}
},
"/api/user/user_like_post": {
"get": {
"post": {
"tags": [
"User"
],
Expand Down Expand Up @@ -1411,7 +1411,15 @@
"Admin"
],
"description": "รับข้อมูล report post ทั้งหมด",
"parameters": [],
"parameters": [
{
"name": "sortby",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
Expand All @@ -1428,7 +1436,15 @@
"Admin"
],
"description": "รับข้อมูล report comment ทั้งหมด",
"parameters": [],
"parameters": [
{
"name": "sortby",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
Expand All @@ -1445,7 +1461,15 @@
"Admin"
],
"description": "รับข้อมูล report reply ทั้งหมด",
"parameters": [],
"parameters": [
{
"name": "sortby",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
Expand Down