-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create addkindergarten query in the addKindergarten file
Relates #18
- Loading branch information
Alaa Sahloub
committed
Feb 15, 2021
1 parent
bdd116f
commit 91a17e1
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { connection } = require('../../data'); | ||
|
||
const addKindergarten = ( | ||
kindergartenName, | ||
coverImage, | ||
description, | ||
phoneNumber, | ||
latitude, | ||
longitude, | ||
minPrice, | ||
maxPrice, | ||
periods, | ||
imagesGallery | ||
) => { | ||
const sql = { | ||
text: | ||
'INSERT INTO kindergarten (kindergarten_name, cover_image, description, phone_number, latitude, longitude, min_price, max_price, periods, images_gallery) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9 , $10) ', | ||
values: [ | ||
kindergartenName, | ||
coverImage, | ||
description, | ||
phoneNumber, | ||
latitude, | ||
longitude, | ||
minPrice, | ||
maxPrice, | ||
periods, | ||
imagesGallery, | ||
], | ||
}; | ||
return connection.query(sql); | ||
}; | ||
|
||
module.exports = addKindergarten; |