Skip to content

Commit

Permalink
alluser-> userList로 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
KimKyuBong committed Nov 18, 2023
1 parent 6be0441 commit bb56d0e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
5 changes: 2 additions & 3 deletions routes/admin/adminRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const itemCheckRouter = require("./inventory/itemCheck");
const inventoryCheckRouter = require("./inventory/inventoryCheck");
const receiptCheckRouter = require("./inventory/receiptCheck");
const inventoryExcelRouter = require("./inventory/excel");
// const removedItemBarcode = require("./inventory/removeItemBarcode");

const barcodeRouter = require("./auth/barcode");

Expand All @@ -20,7 +19,7 @@ const payRouter = require("./transaction/pay");
const chargeLogRouter = require("./transaction/chargelog");
const payLogRouter = require("./transaction/paylog");

const allUserRouter = require("./all/alluser");
const userListRouter = require("./auth/userList");
const allChargeRouter = require("./all/allCharge");

const pwChangeRouter = require("./auth/pwchange");
Expand All @@ -38,7 +37,7 @@ router.use("/payuserlog", adminPayUserLogRouter);
router.use("/chargelog", chargeLogRouter);
router.use("/paylog", payLogRouter);

router.use("/alluser", allUserRouter);
router.use("/userList", userListRouter);
router.use("/pwchange", pwChangeRouter);

router.use("/insertinventory", insertInventoryRouter);
Expand Down
9 changes: 5 additions & 4 deletions routes/admin/all/alluser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ const { executeQueryPromise } = require("@query");
const router = express.Router();
router.use(express.json());

router.get("/", async(req, res) => {
const sql = `SELECT code_number, student_name FROM users`;
router.get("/", async (req, res) => {
const sql =
"SELECT code_number, student_name, email, point, is_admin, is_coop FROM users";
try {
const result = await executeQueryPromise(sql);
return res.status(200).send(result);
} catch(err) {
} catch (err) {
console.error(err);
return res.status(500).json({ error: "Internal server error." });
}
});

module.exports = router;
module.exports = router;
18 changes: 18 additions & 0 deletions routes/admin/auth/userList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const express = require("express");
const { executeQueryPromise } = require("@query");
const router = express.Router();
router.use(express.json());

router.get("/", async (req, res) => {
const sql =
"SELECT code_number, student_name, is_coop, email, point, is_admin FROM users";
try {
const result = await executeQueryPromise(sql);
return res.status(200).send(result);
} catch (err) {
console.error(err);
return res.status(500).json({ error: "Internal server error." });
}
});

module.exports = router;

0 comments on commit bb56d0e

Please sign in to comment.