Skip to content

Commit

Permalink
Merge pull request #18 from philippebeck/dev
Browse files Browse the repository at this point in the history
Release 0.12.1
  • Loading branch information
philippebeck authored Feb 5, 2023
2 parents dc8efa1 + 7980ee8 commit 76ea666
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 8 deletions.
24 changes: 22 additions & 2 deletions api/controller/UserCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,28 @@ exports.setMessage = (fields, res) => {

//! ****************************** PUBLIC ******************************

exports.checkUser = () => {

/**
* CHECK USERS
* @param {object} req
* @param {object} res
*/
exports.checkUsers = (req, res) => {
UserModel
.find()
.then((users) => {
let usersChecked = [];
for (let i = 0; i < users.length; i++) {

usersChecked.push({
_id: users[i]._id,
name: users[i].name,
email: users[i].email
});
}
res.status(200).json(usersChecked);
}
)
.catch((error) => res.status(400).json({ error }));
}

/**
Expand Down
4 changes: 4 additions & 0 deletions api/model/OrderModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const OrderModel = mongoose.Schema(
type: Number,
required: true
},
payment: {
type: String,
required: true
},
user: {
type: String,
required: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vesan",
"version": "0.12.0",
"version": "0.12.1",
"description": "CMS with Vue-Elt, Servidio, Animadio & NemJS",
"keywords": [
"cms",
Expand Down
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export default {
methods: {
logout() {
localStorage.clear();
localStorage.removeItem("userId");
localStorage.removeItem("userToken");
this.$router.go();
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/managers/ListComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ import constants from "/constants";
export default {
name: "ListComments",
props: ["comments", "article", "articles", "users"],
props: ["comments", "articles", "users"],
methods: {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/managers/ListReviews.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ import constants from "/constants";
export default {
name: "ListReviews",
props: ["reviews", "product", "products", "users"],
props: ["reviews", "products", "users"],
methods: {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/views/ArticleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {
.then(res => { this.comments = res })
.catch(err => { console.log(err) });
this.$serve.getData("/api/users")
this.$serve.getData("/api/users/check")
.then(res => { this.users = res })
.catch(err => { console.log(err) });
Expand Down
4 changes: 3 additions & 1 deletion src/views/ProductView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default {
.then(res => { this.reviews = res })
.catch(err => { console.log(err) });
this.$serve.getData("/api/users")
this.$serve.getData("/api/users/check")
.then(res => { this.users = res })
.catch(err => { console.log(err) });
Expand Down Expand Up @@ -252,6 +252,8 @@ export default {
localStorage.setItem("basket", JSON.stringify(this.basket));
alert(`${this.order.quantity} "${this.product.name}" (${this.order.option}) has been added to the Basket !`);
this.$router.push("/shop");
}
}
}
Expand Down

0 comments on commit 76ea666

Please sign in to comment.