This commit is contained in:
newtbot
2024-01-24 16:01:30 +08:00
parent d0aeab286a
commit 7403f66c8a
12 changed files with 44 additions and 114 deletions

View File

@ -6,7 +6,6 @@ async function getLocation() {
}
async function addLocation(name, added_by, description) {
console.log(name, added_by, description);
const location = await locationModel.create({
name: name,
added_by: added_by,
@ -30,7 +29,6 @@ async function updateLocation(id, name, added_by, description) {
}
async function deleteLocation(id) {
//delete by id
const location = await locationModel.destroy({
where: {
id: id,
@ -38,6 +36,7 @@ async function deleteLocation(id) {
});
}
async function getLocationById(id) {
const location = await locationModel.findAll({
where: {