fix: small fixes on loyalty module
This commit is contained in:
parent
768b5a30e1
commit
29257c42ec
1 changed files with 3 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ function getAvailableIndividualDiscounts () {
|
||||||
const sql = `SELECT * from individual_discounts WHERE soft_deleted=false`
|
const sql = `SELECT * from individual_discounts WHERE soft_deleted=false`
|
||||||
return db.any(sql).then(res => _.map(it => ({
|
return db.any(sql).then(res => _.map(it => ({
|
||||||
id: it.id,
|
id: it.id,
|
||||||
idType: it.identification,
|
idType: _.camelCase(it.identification),
|
||||||
value: it.value,
|
value: it.value,
|
||||||
discount: it.discount,
|
discount: it.discount,
|
||||||
softDeleted: it.soft_deleted
|
softDeleted: it.soft_deleted
|
||||||
|
|
@ -44,8 +44,8 @@ function createIndividualDiscount (idType, value, discount) {
|
||||||
idNumber: 'id_number'
|
idNumber: 'id_number'
|
||||||
}
|
}
|
||||||
|
|
||||||
const sql = `INSERT INTO individual_discounts (id, identification, value, discount) VALUES ($1, $2, $3, $4) RETURNING *`
|
const sql = `INSERT INTO individual_discounts (id, identification, value, discount) VALUES ($1, $2, $3, $4)`
|
||||||
return db.one(sql, [uuid.v4(), idTypes[idType], value, discount])
|
return db.none(sql, [uuid.v4(), idTypes[idType], value, discount])
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteIndividualDiscount (id) {
|
function deleteIndividualDiscount (id) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue