Skip to content

Commit

Permalink
Fix definition of async restify routes
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoldfar committed May 20, 2024
1 parent e2056ae commit 8dfcc94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let dbConnected = false;
const API_USER = config.conf.get('API_USER');
const API_PASSWORD = config.conf.get('API_PASSWORD');

async function Get(req, res, next) {
async function Get(req, res) {
try {
const from = parseInt(req.query?.from || '0');
const limit = parseInt(req.query?.limit || '10');
Expand All @@ -37,7 +37,7 @@ async function Get(req, res, next) {
}
}

async function Post(req, res, next) {
async function Post(req, res) {
try {
const name = req.body?.name || null;
const description = req.body?.description || null;
Expand All @@ -56,7 +56,7 @@ async function Post(req, res, next) {
}
}

async function Put(req, res, next) {
async function Put(req, res) {
try {
// check if user passed valid authentication header
if (req.username === 'anonymous' ||
Expand Down Expand Up @@ -85,7 +85,7 @@ async function Put(req, res, next) {
next(err);
}
}
async function Delete(req, res, next) {
async function Delete(req, res) {
try {
// check if user passed valid authentication header
if (req.username === 'anonymous' ||
Expand Down

0 comments on commit 8dfcc94

Please sign in to comment.