added description to list of modifyable parameters
This commit is contained in:
parent
ff6a17d0da
commit
85bf0d208a
|
|
@ -83,12 +83,13 @@ const insertUserHasPlacesQuery = ({ user_uuid, place_uuid, description, createdB
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
const modifyUserHasPlacesQuery = ({user_uuid, place_uuid, report_type_uuid, rating, images}) => {
|
const modifyUserHasPlacesQuery = ({user_uuid, place_uuid, report_type_uuid, rating, images, description}) => {
|
||||||
const user_uuidCondition = user_uuid ? 'fk_user = (SELECT id FROM dbmaster.users WHERE uuid = :user_uuid),' : ``;
|
const user_uuidCondition = user_uuid ? 'fk_user = (SELECT id FROM dbmaster.users WHERE uuid = :user_uuid),' : ``;
|
||||||
const place_uuidCondition = place_uuid ? 'fk_place = (SELECT id FROM dbmaster.places WHERE uuid = :place_uuid),' : ``;
|
const place_uuidCondition = place_uuid ? 'fk_place = (SELECT id FROM dbmaster.places WHERE uuid = :place_uuid),' : ``;
|
||||||
const report_type_uuidCondition = report_type_uuid ? 'fk_report_type = (SELECT id FROM dbmaster.report_types WHERE uuid = :report_type_uuid),' : ``;
|
const report_type_uuidCondition = report_type_uuid ? 'fk_report_type = (SELECT id FROM dbmaster.report_types WHERE uuid = :report_type_uuid),' : ``;
|
||||||
const ratingCondition = rating ? 'rating = :rating,' : ``;
|
const ratingCondition = rating ? 'rating = :rating,' : ``;
|
||||||
const imagesCondition = images ? `images = :images,` : '';
|
const imagesCondition = images ? `images = :images,` : '';
|
||||||
|
const descriptionCondition = description ? `description = :description,` : ``;
|
||||||
return `
|
return `
|
||||||
UPDATE dbmaster.users_has_places
|
UPDATE dbmaster.users_has_places
|
||||||
SET
|
SET
|
||||||
|
|
@ -97,6 +98,7 @@ const modifyUserHasPlacesQuery = ({user_uuid, place_uuid, report_type_uuid, rati
|
||||||
${report_type_uuidCondition}
|
${report_type_uuidCondition}
|
||||||
${ratingCondition}
|
${ratingCondition}
|
||||||
${imagesCondition}
|
${imagesCondition}
|
||||||
|
${descriptionCondition}
|
||||||
uuid = :uuid
|
uuid = :uuid
|
||||||
WHERE
|
WHERE
|
||||||
users_has_places.uuid = :uuid
|
users_has_places.uuid = :uuid
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue