chore: add typecheck and linting for backend

This commit is contained in:
dec0dOS 2023-10-04 20:02:57 +01:00
parent 70c580474c
commit bdf406f99f
10 changed files with 124 additions and 11 deletions

View file

@ -8,6 +8,7 @@ const api = require("../utils/controller-api");
// get all members
router.get("/", auth.isAuthorized, async function (req, res) {
// @ts-ignore
const nwid = req.params.nwid;
api
.get("controller/network/" + nwid + "/member")
@ -23,6 +24,7 @@ router.get("/", auth.isAuthorized, async function (req, res) {
// get member
router.get("/:mid", auth.isAuthorized, async function (req, res) {
// @ts-ignore
const nwid = req.params.nwid;
const mid = req.params.mid;
const data = await member.getMembersData(nwid, [mid]);
@ -35,6 +37,7 @@ router.get("/:mid", auth.isAuthorized, async function (req, res) {
// update member
router.post("/:mid", auth.isAuthorized, async function (req, res) {
// @ts-ignore
const nwid = req.params.nwid;
const mid = req.params.mid;
member.updateMemberAdditionalData(nwid, mid, req.body);
@ -56,6 +59,7 @@ router.post("/:mid", auth.isAuthorized, async function (req, res) {
// delete member
router.delete("/:mid", auth.isAuthorized, async function (req, res) {
// @ts-ignore
const nwid = req.params.nwid;
const mid = req.params.mid;
member.deleteMemberAdditionalData(nwid, mid);