Skip to content

Commit 8aaba2c

Browse files
Ajen07cherylli
andauthored
chore: change reseed endpoint to public
* refactor: updated the endpoint to public and removed unauthorized tests * fix changelog --------- Co-authored-by: Cheryl M <webmaster@cherylli.com>
1 parent 9e2d3ca commit 8aaba2c

File tree

3 files changed

+4
-31
lines changed

3 files changed

+4
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
1616
## [Unreleased]
1717

18-
- Updated readme for installation part ([#225])(https://github.com/chingu-x/chingu-dashboard-be/pull/225)
19-
- Updated nestjs packages to latest version ([#233])(https://github.com/chingu-x/chingu-dashboard-be/pull/233)
20-
- Refactoring of email service + unit tests ([#232](https://github.com/chingu-x/chingu-dashboard-be/pull/232))
21-
- Added version release link to Swagger docs ([#218](https://github.com/chingu-x/chingu-dashboard-be/pull/231))
22-
- Fixed POST voyages/teams/{teamId}/techs bug , verify that categoryId is owned by correct team ([#229](https://github.com/chingu-x/chingu-dashboard-be/pull/229))
23-
2418
### Added
2519

2620
- Added release please github actions ([#235])(https://github.com/chingu-x/chingu-dashboard-be/pull/235)
@@ -33,23 +27,11 @@
3327
- Refactoring of email service + unit tests ([#232](https://github.com/chingu-x/chingu-dashboard-be/pull/232))
3428

3529
### Fixed
36-
37-
3830
- fixed POST voyages/teams/{teamId}/techs bug , verify that categoryId is owned by correct team ([#229](https://github.com/chingu-x/chingu-dashboard-be/pull/229))
39-
### Removed
40-
41-
## [v1.1.0-alpha]
42-
- Refactoring of email service + unit tests ([#232](https://github.com/chingu-x/chingu-dashboard-be/pull/232))
43-
44-
45-
### Added
46-
47-
### Changed
48-
49-
### Fixed
5031

5132
### Removed
5233

34+
5335
## [v1.1.0-alpha]
5436

5537
### Added

src/development/development.controller.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import { Response } from "express";
55
import { ReSeedSuccessResponse } from "./development.response";
66
import {
77
ServerErrorResponse,
8-
UnauthorizedErrorResponse,
98
UnprocessableEntityErrorResponse,
109
} from "../global/responses/errors";
10+
import { Public } from "@/global/decorators/public.decorator";
1111

1212
@Controller("development")
1313
@ApiTags("Development")
1414
export class DevelopmentController {
1515
constructor(private readonly developmentService: DevelopmentService) {}
1616

1717
@ApiOperation({
18-
summary: "Reseed the database",
18+
summary: "Public Route:Reseed the database",
1919
description:
2020
"It will take a while, maybe minutes. Then you'll be logged out.",
2121
})
@@ -24,11 +24,6 @@ export class DevelopmentController {
2424
description: "Successfully reseeded the database",
2525
type: ReSeedSuccessResponse,
2626
})
27-
@ApiResponse({
28-
status: HttpStatus.UNAUTHORIZED,
29-
description: "unauthorized access - not logged in",
30-
type: UnauthorizedErrorResponse,
31-
})
3227
@ApiResponse({
3328
status: HttpStatus.UNPROCESSABLE_ENTITY,
3429
description: "using this endpoint in non development environment.",
@@ -39,6 +34,7 @@ export class DevelopmentController {
3934
description: "Reseeding failed.",
4035
type: ServerErrorResponse,
4136
})
37+
@Public()
4238
@Put("database/reseed")
4339
reseedDatabase(@Res() res: Response) {
4440
return this.developmentService.reseedDatabase(res);

test/development.e2e-spec.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ describe("Development Controller (e2e)", () => {
4242
});
4343

4444
describe("PUT /development/database/reseed", () => {
45-
it("should return 401 if user is not logged in", async () => {
46-
await request(app.getHttpServer())
47-
.put("/development/database/reseed")
48-
.expect(401);
49-
});
5045
it("should return 422 and not proceed if NODE_ENV is not development", async () => {
5146
const { access_token, refresh_token } = await loginAndGetTokens(
5247
"jessica.williamson@gmail.com",

0 commit comments

Comments
 (0)