Skip to content

Commit

Permalink
Remove feature flag from arts/userId?dev=true API Endpoint (#2289)
Browse files Browse the repository at this point in the history
* added new route to fetch user art

* added new route under featureflag

* added test cases for new route

* wrote 2 new test cases and and one no content cond.

* removing feature flag
  • Loading branch information
vikasosmium authored Dec 5, 2024
1 parent daed096 commit 5dc221c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion routes/arts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { devFlagMiddleware } from "../middlewares/devFlag";
router.get("/", arts.fetchArts);
router.get("/user/self", authenticate, arts.getSelfArts); // this route is soon going to be deprecated soon, please use /arts/:userId endpoint.
router.get("/user/:userId", authenticate, arts.getUserArts); // this route is soon going to be deprecated soon, please use /arts/:userId endpoint.
router.get("/:userId", devFlagMiddleware, authenticate, arts.getUserArts);
router.get("/:userId", authenticate, arts.getUserArts);
router.post("/user/add", authenticate, artValidator.createArt, arts.addArt);

module.exports = router;
8 changes: 4 additions & 4 deletions test/integration/arts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe("Arts", function () {
it("Should get all the arts of the user", function (done) {
chai
.request(app)
.get(`/arts/${userId}?dev=true`)
.get(`/arts/${userId}`)
.set("cookie", `${cookieName}=${jwt}`)
.end((err, res) => {
if (err) {
Expand All @@ -172,7 +172,7 @@ describe("Arts", function () {
it("Should return 401, for Unauthenticated User", function (done) {
chai
.request(app)
.get(`/arts/${userId}?dev=true`)
.get(`/arts/${userId}`)
.end((err, res) => {
if (err) {
return done(err);
Expand All @@ -195,7 +195,7 @@ describe("Arts", function () {

chai
.request(app)
.get(`/arts/${userId}?dev=true`)
.get(`/arts/${userId}`)
.set("cookie", `${cookieName}=${jwt}`)
.end((err, res) => {
artsQuery.fetchUserArts.restore();
Expand All @@ -215,7 +215,7 @@ describe("Arts", function () {

chai
.request(app)
.get(`/arts/${userId}?dev=true`)
.get(`/arts/${userId}`)
.set("cookie", `${cookieName}=${jwt}`)
.end((err, res) => {
artsQuery.fetchUserArts.restore();
Expand Down

0 comments on commit 5dc221c

Please sign in to comment.