Skip to content

Commit

Permalink
feat: add request query to string in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed May 20, 2023
1 parent 08c5e80 commit 2695ccd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/controller.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ class Controller {
}
return strArr.join(" ");
}

queryToString() {
let strArr = [];
let keys = Object.keys(this.request.query);
for(let i = 0 ; i < keys.length; i++) {
let key = keys[i];
strArr.push(`${key}: ${this.request.query[key]}`);
}
return strArr.join(" ");
}
}

module.exports.Controller = Controller;

0 comments on commit 2695ccd

Please sign in to comment.