Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
4111b32
add proxyquire & sequelize-mock npm lib
AmberYen Oct 12, 2021
161a837
add new A17 test
AmberYen Oct 12, 2021
bb8ce89
tests/A17.test.js added comments
AmberYen Oct 18, 2021
c15fe79
add A19 test
AmberYen Oct 18, 2021
da713e0
add A20 test
AmberYen Oct 18, 2021
88812da
add A21 test
AmberYen Oct 18, 2021
a7d56e1
add A22 test
AmberYen Oct 18, 2021
d4a7391
add commnets for A17
AmberYen Oct 19, 2021
e981eb0
add comments for A19
AmberYen Oct 19, 2021
5396cf6
add comments for A22
AmberYen Oct 19, 2021
dab9f1d
add comments for A21
AmberYen Oct 19, 2021
c7a336d
add comments for A22
AmberYen Oct 19, 2021
a175811
adjust coding style
Carrot7712 Oct 27, 2021
39950b9
修改變數名與註解
Carrot7712 Oct 27, 2021
82de6c8
refactor mock db in unit test / integrated into helpers/unitTestHelpers
AmberYen Oct 28, 2021
c9b201e
remove n_comments check due to follow model answer
AmberYen Oct 28, 2021
50476ab
revise comments
Carrot7712 Oct 28, 2021
b3ddfcd
add A21 test userId and restaurantId with addLike function
AmberYen Oct 29, 2021
6c5f774
add viewCounts check in A20
AmberYen Oct 29, 2021
2ad4b59
add new test comment
AmberYen Oct 29, 2021
a2df6a4
remove other test and rename A17 -> R01
AmberYen Oct 31, 2021
2f9c683
changed all test file name
AmberYen Oct 31, 2021
d3a66dd
remove R03/04/05 test
AmberYen Oct 31, 2021
e0dbcb6
remove R04/05 test
AmberYen Oct 31, 2021
5a83153
remove R05 test
AmberYen Oct 31, 2021
9148715
fixed R01 ../../app issue & not found sequelize lib
AmberYen Nov 1, 2021
154a12e
fixed R01 ../../app issue & not found sequelize lib
AmberYen Nov 1, 2021
c3b664c
fixed R01 ../../app issue & not found sequelize lib
AmberYen Nov 1, 2021
67b9b32
fixed R01 ../../app issue & not found sequelize lib
AmberYen Nov 1, 2021
3e9b544
fixed R01 ../../app issue & not found sequelize lib
AmberYen Nov 1, 2021
ba68733
fixed controller path wrong issue / check data exist
AmberYen Nov 1, 2021
3f256dc
fixed controller path wrong issue / check data exist
AmberYen Nov 1, 2021
0ab85cd
fixed wrong path
AmberYen Nov 1, 2021
a342d2d
fixed controller path wrong issue / check data exist
AmberYen Nov 1, 2021
b10ee15
fixed wrong path
AmberYen Nov 1, 2021
28011ed
fixed controller path wrong issue / check data exist
AmberYen Nov 1, 2021
9b8b4b1
fixed wrong path
AmberYen Nov 1, 2021
5a77ed6
fixed controller path wrong issue / check data exist
AmberYen Nov 1, 2021
c044bab
fixed wrong path
AmberYen Nov 1, 2021
e39f3b4
add mockRequest / mockResponse
AmberYen Nov 1, 2021
47a1370
use new mockRequest / mockResponse
AmberYen Nov 1, 2021
371709f
R02 use new mockRequest / mockResponse
AmberYen Nov 1, 2021
e45367f
add mockRequest / mockResponse
AmberYen Nov 1, 2021
d487f4a
use new mockRequest / mockResponse
AmberYen Nov 1, 2021
73fc123
require sinon
AmberYen Nov 1, 2021
5224b9a
remove sinon
AmberYen Nov 1, 2021
5d61a30
add mockRequest / mockResponse
AmberYen Nov 1, 2021
51b22d5
use new mockRequest / mockResponse
AmberYen Nov 1, 2021
eba6e76
require sinon
AmberYen Nov 1, 2021
70db2a5
remove sinon
AmberYen Nov 1, 2021
94b4d56
remove sinon
AmberYen Nov 1, 2021
2d18631
add mockRequest / mockResponse
AmberYen Nov 1, 2021
a79fdd0
use new mockRequest / mockResponse
AmberYen Nov 1, 2021
7fef8c7
require sinon
AmberYen Nov 1, 2021
c8beeb2
add mockRequest / mockResponse
AmberYen Nov 1, 2021
3a85cde
use new mockRequest / mockResponse
AmberYen Nov 1, 2021
61c6de7
require sinon
AmberYen Nov 1, 2021
8927621
remove sinon
AmberYen Nov 1, 2021
44176de
require sinon
AmberYen Nov 1, 2021
8934182
remove sinon
AmberYen Nov 1, 2021
4219d1f
return [defaulvalue] when findall data empty
AmberYen Nov 1, 2021
9bf30ca
return [defaulvalue] when findall data empty
AmberYen Nov 1, 2021
05b87a2
remove done param
AmberYen Nov 2, 2021
c014106
remove done param
AmberYen Nov 2, 2021
6eecc8a
remove done param
AmberYen Nov 2, 2021
a04125f
remove done param
AmberYen Nov 2, 2021
96e3daa
remove done param
AmberYen Nov 2, 2021
a1cf9c3
update readme config.json package.json
Carrot7712 Nov 3, 2021
5e1573a
Update .travis.yml
Carrot7712 Nov 5, 2021
c71da44
Update .travis.yml
Carrot7712 Nov 5, 2021
1da8f64
R02 use new mockRequest / mockResponse
AmberYen Nov 1, 2021
dcc8f0e
add helper ref
AmberYen Nov 7, 2021
6799804
remove mockRequest, mockResponse
AmberYen Nov 7, 2021
97752ae
use new mockRequest, mockResponse
AmberYen Nov 7, 2021
d54a7fd
R02 use new mockRequest / mockResponse
AmberYen Nov 1, 2021
dde5d1d
add helper ref
AmberYen Nov 7, 2021
ec34393
R02 use new mockRequest / mockResponse
AmberYen Nov 1, 2021
8b395b2
add helper ref
AmberYen Nov 7, 2021
59826d4
remove mockRequest, mockResponse
AmberYen Nov 7, 2021
c74a905
add helper ref
AmberYen Nov 7, 2021
049790e
use new mockRequest, mockResponse
AmberYen Nov 7, 2021
a9d4082
use new mockRequest, mockResponse
AmberYen Nov 7, 2021
7f8789b
use new mockRequest, mockResponse
AmberYen Nov 7, 2021
72b9738
update readme config.json package.json
Carrot7712 Nov 3, 2021
8c88719
Update .travis.yml
Carrot7712 Nov 5, 2021
ec2c6df
Update .travis.yml
Carrot7712 Nov 5, 2021
80d4dd1
update readme config.json package.json
Carrot7712 Nov 3, 2021
7dc7a56
Update .travis.yml
Carrot7712 Nov 5, 2021
88575da
Update .travis.yml
Carrot7712 Nov 5, 2021
dd4522b
update readme config.json package.json
Carrot7712 Nov 3, 2021
894675f
Update .travis.yml
Carrot7712 Nov 5, 2021
da3a406
Update .travis.yml
Carrot7712 Nov 5, 2021
29a2fb9
update readme config.json package.json
Carrot7712 Nov 3, 2021
dcd7e2a
Update .travis.yml
Carrot7712 Nov 5, 2021
5306afe
Update .travis.yml
Carrot7712 Nov 5, 2021
29dd825
Update config.json
Carrot7712 Nov 8, 2021
20cab63
Update config.json
Carrot7712 Nov 8, 2021
844162a
Update config.json
Carrot7712 Nov 8, 2021
32a6374
Update config.json
Carrot7712 Nov 8, 2021
e55d7f7
Update config.json
Carrot7712 Nov 8, 2021
01fb2c5
Initialize project
heidichen90 Nov 8, 2021
c48093b
set up restaurant entry point
heidichen90 Nov 8, 2021
5afa2dd
set up admin/restaurant
heidichen90 Nov 8, 2021
3c5d69c
set up user model
heidichen90 Nov 8, 2021
144f5e3
run standard fix
heidichen90 Nov 8, 2021
ea3b1dd
set up sign up page
heidichen90 Nov 9, 2021
3ed95c5
set up flash message for sign up page
heidichen90 Nov 9, 2021
e9f785d
add passport. pull updated upstream master
heidichen90 Nov 9, 2021
9e6a03e
cimplete signin feature with passport authentication
heidichen90 Nov 9, 2021
e21a074
add Navbar
heidichen90 Nov 9, 2021
6815e99
setup admin check
heidichen90 Nov 10, 2021
e74effb
set up restaurants admin page
heidichen90 Nov 10, 2021
8aae24d
view one restaurant
heidichen90 Nov 10, 2021
66aca39
edit a restaurant
heidichen90 Nov 10, 2021
8d7626c
delete a restaurant
heidichen90 Nov 10, 2021
bc1dff5
correct styling
heidichen90 Nov 10, 2021
b75685e
add image column in db
heidichen90 Nov 10, 2021
3391bb4
upload image for restaurant
heidichen90 Nov 11, 2021
8df342a
add user seeder
heidichen90 Nov 11, 2021
5f414d4
set up restaurant seeder
heidichen90 Nov 11, 2021
2532b27
integrate with imgur api
heidichen90 Nov 11, 2021
157c68d
Install pg and update production config
heidichen90 Nov 11, 2021
5c4a382
update port and procfile
heidichen90 Nov 11, 2021
41e6060
heroku PG switch to ClearDB mysql
heidichen90 Nov 11, 2021
69bc6f2
fix conflict
heidichen90 Nov 11, 2021
e8f98a4
amend code with helpers
heidichen90 Nov 11, 2021
f38bb34
correct the error using helpers
heidichen90 Nov 11, 2021
4d56bbf
add change user permission
heidichen90 Nov 12, 2021
1043690
remove console.log
heidichen90 Nov 12, 2021
12f8169
correct logic only block root user admin access change
heidichen90 Nov 12, 2021
1ac970d
add category table and associate cateogry id to restaurant
heidichen90 Nov 14, 2021
c29f21a
change restaurantId,userId to UserId, RestaurantId
AmberYen Nov 15, 2021
85385f2
fixed typo
AmberYen Nov 15, 2021
d9c5450
set up seeder file
heidichen90 Nov 15, 2021
7e2b869
javascript styling fix
heidichen90 Nov 15, 2021
b97773b
render category info in restaurant lists
heidichen90 Nov 15, 2021
6f0bb69
add category in create screen
heidichen90 Nov 15, 2021
093f8ce
add helpers to set selected category
heidichen90 Nov 15, 2021
f79b72f
add admin/categories and getCategories function in categoryController
heidichen90 Nov 16, 2021
5d9b9df
add post category feature
heidichen90 Nov 16, 2021
73e2a62
update category
heidichen90 Nov 16, 2021
01a236a
delete category
heidichen90 Nov 16, 2021
8b8cb28
get all restaurants for normal user
heidichen90 Nov 16, 2021
0b4d87a
show restaurant detail
heidichen90 Nov 16, 2021
2800f4d
fix javascript styling
heidichen90 Nov 16, 2021
7ed0de0
filter restaurant list
heidichen90 Nov 16, 2021
eeaaa2d
add pagination feature
heidichen90 Nov 16, 2021
0b89e2b
center pagination component
heidichen90 Nov 17, 2021
3901790
correct javascript styling
heidichen90 Nov 17, 2021
13abc4b
return [defaulvalue] when findall data empty
Carrot7712 Nov 17, 2021
69ccf9f
return [defaulvalue] when findall data empty
Carrot7712 Nov 17, 2021
c89b49c
set up comment data model
heidichen90 Nov 17, 2021
7ced850
add post comment controller
heidichen90 Nov 17, 2021
724e826
show comment in restaurant page
heidichen90 Nov 17, 2021
567dae8
admin user to delete comment
heidichen90 Nov 18, 2021
efab594
merge
heidichen90 Nov 18, 2021
85479b3
merge with upstream/R02-test
heidichen90 Nov 18, 2021
9bd4161
remove merge conflict duplciation
heidichen90 Nov 18, 2021
b84a195
fix javascript coding style
heidichen90 Nov 18, 2021
a317a44
user profile feature
heidichen90 Nov 19, 2021
39ba4ff
fix production connection
heidichen90 Nov 19, 2021
c043d41
display user's commit on profile page
heidichen90 Nov 19, 2021
6a31e46
fix missing graph and fix seeder id generate
heidichen90 Nov 19, 2021
a2bca88
add feeds page
heidichen90 Nov 20, 2021
0723dcd
Conflicts resolved
heidichen90 Nov 20, 2021
32f69a2
refactor with promis.all
heidichen90 Nov 20, 2021
65c2ca6
fix styling before start ti implement feature
heidichen90 Nov 20, 2021
cd4263c
block user editing others profile
heidichen90 Nov 20, 2021
f19cadd
merge to updated R02
heidichen90 Nov 20, 2021
a199b89
correct reference name
heidichen90 Nov 20, 2021
eedbd45
amend code to use helpers
heidichen90 Nov 20, 2021
ece32bf
merge with R02 and correct styling
heidichen90 Nov 20, 2021
2a3b738
merge with master
heidichen90 Nov 20, 2021
508d6bd
merge with master
heidichen90 Nov 20, 2021
66fe73e
make sure R03 up-to-date
heidichen90 Nov 20, 2021
5fa68da
merge restController
heidichen90 Nov 20, 2021
f158181
clean up changes
heidichen90 Nov 20, 2021
a49b72c
add dashboard view to show comment
heidichen90 Nov 20, 2021
c97de3f
fix styling
heidichen90 Nov 20, 2021
b642c0b
add dashboard view to show comment
heidichen90 Nov 20, 2021
6f18312
fix styling and merge conflict
heidichen90 Nov 20, 2021
ee1e8e6
fix styling and merge conflict
heidichen90 Nov 20, 2021
7e661a8
add view counts
heidichen90 Nov 20, 2021
160e758
hide edit button when viewing other's profile
heidichen90 Nov 20, 2021
0ba3289
fix styling
heidichen90 Nov 20, 2021
7300404
create favorite model and set association between restaurant and user
heidichen90 Nov 20, 2021
55964f3
Add favorite/unfavorite feature
heidichen90 Nov 20, 2021
7e0fd2a
add add/remove favorite button to restaurant single page and restaura…
heidichen90 Nov 20, 2021
f1cf40f
fix styling
heidichen90 Nov 20, 2021
dc7d8e1
merge with R04-test
heidichen90 Nov 20, 2021
d7ce5e6
merge with R04-test
heidichen90 Nov 20, 2021
87cb316
merge with R04-test
heidichen90 Nov 20, 2021
4c5f6ce
merge with R04-test
heidichen90 Nov 20, 2021
f7d7a9a
fix duplicate mockRequest
heidichen90 Nov 20, 2021
389417e
add like/unlike feature
heidichen90 Nov 20, 2021
58e426a
fix testing failure
heidichen90 Nov 21, 2021
73350d3
fix css styling
heidichen90 Nov 21, 2021
915133d
fix css styling
heidichen90 Nov 21, 2021
126baf8
fix css styling
heidichen90 Nov 21, 2021
3354835
create followship model and add follower and followers to users
heidichen90 Nov 21, 2021
37239f5
add topUser page
heidichen90 Nov 21, 2021
a861070
addfollowing and deletefollowing
heidichen90 Nov 21, 2021
0afbb7e
pull R05-test
heidichen90 Nov 21, 2021
57fcdfa
pull R05-test
heidichen90 Nov 21, 2021
76f3507
fix merge issue with R05
heidichen90 Nov 21, 2021
68028b1
update R05.test
heidichen90 Nov 21, 2021
12e2841
view top restaurants
heidichen90 Nov 22, 2021
953066f
fix R05
heidichen90 Nov 22, 2021
76af754
refactor on admincontroller.getRestaurants
heidichen90 Nov 25, 2021
42a27ed
refactor adminController.getRestaurant
heidichen90 Nov 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IMGUR_CLIENT_ID=SKIP
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules/
temp/
upload/


.DS_Store
.env
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: NODE_ENV=production node app.js
12 changes: 6 additions & 6 deletions _helpers.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function ensureAuthenticated(req) {
return req.isAuthenticated();
function ensureAuthenticated (req) {
return req.isAuthenticated()
}

function getUser(req) {
return req.user;
function getUser (req) {
return req.user
}

module.exports = {
ensureAuthenticated,
getUser,
};
getUser
}
36 changes: 35 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
const express = require('express')
const handlebars = require('express-handlebars')
const db = require('./models')
const flash = require('connect-flash')
const session = require('express-session')
const passport = require('./config/passport')
const methodOverride = require('method-override')

if (process.env.NODE_ENV !== 'production') {
require('dotenv').config()
}

const app = express()
const port = 3000
const port = process.env.PORT || 3000

app.engine(
'handlebars',
handlebars({
defaultLayout: 'main',
helpers: require('./config/handlebars-helpers')
})
)
app.set('view engine', 'handlebars')
app.use(express.urlencoded({ extended: true }))
app.use(session({ secret: 'secret', resave: false, saveUninitialized: false }))
app.use(passport.initialize())
app.use(passport.session())
app.use(flash())
app.use(methodOverride('_method'))
app.use('/upload', express.static(__dirname + '/upload'))

app.use((req, res, next) => {
res.locals.success_messages = req.flash('success_messages')
res.locals.error_messages = req.flash('error_messages')
res.locals.user = req.user
next()
})

app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
Expand Down
3 changes: 1 addition & 2 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"dialect": "mysql"
},
"production": {
"username": "root",
"password": null,
"use_env_variable": "CLEARDB_DATABASE_URL",
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
Expand Down
18 changes: 18 additions & 0 deletions config/handlebars-helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const moment = require('moment')

module.exports = {
ifCond: function (a, b, options) {
if (a === b) {
return options.fn(this)
}
return options.inverse(this)
},

moment: function (a) {
return moment(a).fromNow()
},

count: function (a) {
return a.length
}
}
59 changes: 59 additions & 0 deletions config/passport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const passport = require('passport')
const LocalStrategy = require('passport-local')
const bcrypt = require('bcryptjs')
const db = require('../models')
const User = db.User
const Restaurant = db.Restaurant

// setup passport strategy
passport.use(
new LocalStrategy(
// customize user field
{
usernameField: 'email',
passwordField: 'password',
passReqToCallback: true
},
// authenticate user
(req, username, password, cb) => {
User.findOne({ where: { email: username } }).then((user) => {
if (!user) {
return cb(
null,
false,
req.flash('error_messages', '帳號或密碼輸入錯誤')
)
}
if (!bcrypt.compareSync(password, user.password)) {
return cb(
null,
false,
req.flash('error_messages', '帳號或密碼輸入錯誤')
)
}
user = user.toJSON()
return cb(null, user)
})
}
)
)

// serialize and deserialize user. 只存id不存物件以便省空間
passport.serializeUser((user, cb) => {
cb(null, user.id)
})
passport.deserializeUser((id, cb) => {
User.findByPk(id, {
include: [
{ model: Restaurant, as: 'FavoritedRestaurants' },
{ model: Restaurant, as: 'LikedRestaurants' },
{ model: User, as: 'Followers' },
{ model: User, as: 'Followings' }
]
}).then((user) => {
user = user.toJSON()
return cb(null, user)
})
})

module.exports = passport
165 changes: 165 additions & 0 deletions controllers/adminController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
const db = require("../models");
const Category = db.Category;
const Restaurant = db.Restaurant;
const User = db.User;
// imgur setup
const imgur = require("imgur-node-api");
const IMGUR_CLIENT_ID = process.env.IMGUR_CLIENT_ID;
// Services
const adminServices = require("../services/adminServices");

const adminController = {
getRestaurants: (req, res) => {
return adminServices.getRestaurants(req, res, (data) => {
return res.render("admin/restaurants", data);
});
},

createRestaurants: (req, res) => {
Category.findAll({ raw: true, nest: true }).then((categories) => {
return res.render("admin/create", { categories });
});
},

postRestaurants: (req, res) => {
if (!req.body.name) {
req.flash("error_messages", "name didn't exist");
return res.redirect("back");
}
const { name, tel, address, opening_hours, description, categoryId } =
req.body;
const { file } = req;
if (file) {
imgur.setClientID(IMGUR_CLIENT_ID);
imgur.upload(file.path, (err, img) => {
if (err) console.log("Error: ", err);
return Restaurant.create({
name,
tel,
address,
opening_hours,
description,
image: file ? img.data.link : null,
categoryId,
}).then((restaurant) => {
req.flash("success_messages", "restaurant was successfully created");
return res.redirect("/admin/restaurants");
});
});
} else {
return Restaurant.create({
name,
tel,
address,
opening_hours,
description,
image: null,
}).then((restaurant) => {
req.flash("success_messages", "restaurant was successfully created");
return res.redirect("/admin/restaurants");
});
}
},

getRestaurant: (req, res) => {
return adminServices.getRestaurant(req, res, (data) => {
return res.render("admin/restaurant", data);
});
},

editRestaurant: (req, res) => {
Category.findAll({ raw: true, nest: true }).then((categories) => {
return Restaurant.findByPk(req.params.id, { raw: true, nest: true }).then(
(restaurant) => {
return res.render("admin/create", { restaurant, categories });
}
);
});
},

putRestaurant: (req, res) => {
if (!req.body.name) {
req.flash("error_message", "name didnt exit");
return res.redirect("back");
}

const { file } = req;
const { name, tel, address, opening_hours, description, categoryId } =
req.body;
if (file) {
imgur.setClientID(IMGUR_CLIENT_ID);
imgur.upload(file.path, (err, img) => {
if (err) console.log("Error: ", err);
return Restaurant.findByPk(req.params.id).then((restaurant) => {
restaurant
.update({
name,
tel,
address,
opening_hours,
description,
image: file ? img.data.link : restaurant.image,
categoryId,
})
.then((restaurant) => {
req.flash(
"success_messages",
"restaurant was successfully to update"
);
res.redirect("/admin/restaurants");
});
});
});
} else {
return Restaurant.findByPk(req.params.id).then((restaurant) => {
restaurant
.update({
name,
tel,
address,
opening_hours,
description,
image: restaurant.image,
})
.then((restaurant) => {
req.flash(
"success_messages",
"restaurant was successfully to update"
);
res.redirect("/admin/restaurants");
});
});
}
},

deleteRestaurant: (req, res) => {
return Restaurant.findByPk(req.params.id).then((restaurant) => {
restaurant.destroy().then((restaurant) => {
res.redirect("/admin/restaurants");
});
});
},

getUsers: (req, res) => {
return User.findAll({ raw: true, nest: true }).then((users) => {
return res.render("admin/users", { users });
});
},

toggleAdmin: (req, res) => {
return User.findByPk(req.params.id).then((user) => {
const { isAdmin, email } = user.toJSON();
if (email === "root@example.com") {
req.flash("error_messages", "禁止變更管理者權限");
return res.redirect("back");
} else {
user.update({ isAdmin: !isAdmin }).then((user) => {
req.flash("success_messages", "使用者權限變更成功");
res.redirect("/admin/users");
});
}
});
},
};

module.exports = adminController;
21 changes: 21 additions & 0 deletions controllers/api/adminController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const db = require("../../models");
const Restaurant = db.Restaurant;
const Category = db.Category;

//services
const adminServices = require("../../services/adminServices");

const adminController = {
getRestaurants: (req, res) => {
return adminServices.getRestaurants(req, res, (data) => {
return res.json(data);
});
},
getRestaurant: (req, res) => {
return adminServices.getRestaurant(req, res, (data) => {
return res.json(data);
});
},
};

module.exports = adminController;
Loading