Skip to content

Commit

Permalink
Merge pull request #213 from joshsoftware/feature/node-209-refactor-r…
Browse files Browse the repository at this point in the history
…esponses

update responses in badges, users and core-values controller
  • Loading branch information
sunil4sonawane authored Jun 18, 2020
2 parents be70591 + 5682628 commit 0db900c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions node-backend/controllers/v1/CoreValueController.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ module.exports.findOne = async (req, res) => {
idSchema
.validate({ id, org_id }, { abortEarly: false })
.then(() => {
CoreValue.findAll({ where: { org_id: org_id, id: id } })
CoreValue.findOne({ where: { org_id: org_id, id: id } })
.then((data) => {
if (data.length != 0) {
res.status(200).send({
Expand Down Expand Up @@ -257,7 +257,7 @@ module.exports.getCoreValueById = async (req, res) => {
idSchema
.validate({ id }, { abortEarly: false })
.then(() => {
CoreValue.findAll({
CoreValue.findOne({
where: { id: id },
attributes: [
"id",
Expand Down
2 changes: 1 addition & 1 deletion node-backend/controllers/v1/badgesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports.findOne = async (req, res) => {
idSchema
.validate({ id, org_id }, { abortEarly: false })
.then(() => {
Badges.findAll({ where: { org_id: org_id, id: id } })
Badges.findOne({ where: { org_id: org_id, id: id } })
.then((data) => {
if (data.length != 0) {
res.status(200).send({
Expand Down
2 changes: 1 addition & 1 deletion node-backend/controllers/v1/usersController.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports.getProfileById = async (req, res) => {
idSchema
.validate({ id }, { abortEarly: false })
.then(() => {
Users.findAll({
Users.findOne({
where: { id: id },
attributes: {
exclude: ["soft_delete", "soft_delete_by", "soft_delete_at"],
Expand Down

0 comments on commit 0db900c

Please sign in to comment.