Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Nicolai Ort | e40017a6b8 | |
Nicolai Ort | e843a464e7 | |
Nicolai Ort | d0ae50d557 | |
Nicolai Ort | 7a49e7c5c9 | |
Nicolai Ort | 1dd64204cc | |
Nicolai Ort | 438ff0fc3f | |
Nicolai Ort | c1bbda51f0 | |
Nicolai Ort | 4705a39aab |
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -2,8 +2,21 @@
|
|||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [v0.7.0](https://git.odit.services/lfk/backend/compare/v0.6.4...v0.7.0)
|
||||
|
||||
- Added bulk card creation tests [`438ff0f`](https://git.odit.services/lfk/backend/commit/438ff0fc3f246f83b1fa04cb11828f4a61dfcd1e)
|
||||
- Added new "bulk" endpoint [`c1bbda5`](https://git.odit.services/lfk/backend/commit/c1bbda51f067cbd9ac1a9a5378ae3f5d7b9f4eca)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`7a49e7c`](https://git.odit.services/lfk/backend/commit/7a49e7c5c98eb23af1cd0d2084914641e9a1bf90)
|
||||
- 🚀Bumped version to v0.7.0 [`d0ae50d`](https://git.odit.services/lfk/backend/commit/d0ae50d5579e969ad33d6b9cfd66dac7fa472223)
|
||||
- Merge pull request 'Bulk card creation feature/168-runnercards_bulk' (#169) from feature/168-runnercards_bulk into dev [`1dd6420`](https://git.odit.services/lfk/backend/commit/1dd64204cc63fb1a8a4a4aa503c21da42945eafd)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`4705a39`](https://git.odit.services/lfk/backend/commit/4705a39aabaad894d332a5062df03840c23c6bfa)
|
||||
|
||||
#### [v0.6.4](https://git.odit.services/lfk/backend/compare/v0.6.3...v0.6.4)
|
||||
|
||||
> 19 March 2021
|
||||
|
||||
- Merge pull request 'Release 0.6.4' (#167) from dev into main [`4d721f6`](https://git.odit.services/lfk/backend/commit/4d721f62d9a5f6a1361ef2811a3a2ff63011b2ad)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`b0328ff`](https://git.odit.services/lfk/backend/commit/b0328ffdaffc8ef2e6e01e808c29748f58f42cac)
|
||||
- 🧾New changelog file version [CI SKIP] [skip ci] [`cc6568c`](https://git.odit.services/lfk/backend/commit/cc6568c3810fed3ff2597df0db73a6ca9e072413)
|
||||
- 🚀Bumped version to v0.6.4 [`031cede`](https://git.odit.services/lfk/backend/commit/031cede5426742dc3c2b9dc6b049951d7c14871c)
|
||||
- Adjsuted endpoint [`3c69f8c`](https://git.odit.services/lfk/backend/commit/3c69f8c4a824e588977b06dbb45119cccb03c6bc)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@odit/lfk-backend",
|
||||
"version": "0.6.4",
|
||||
"version": "0.7.0",
|
||||
"main": "src/app.ts",
|
||||
"repository": "https://git.odit.services/lfk/backend",
|
||||
"author": {
|
||||
|
|
|
@ -47,6 +47,21 @@ export class RunnerCardController {
|
|||
return card.toResponse();
|
||||
}
|
||||
|
||||
@Post('/bulk')
|
||||
@Authorized("CARD:CREATE")
|
||||
@ResponseSchema(ResponseEmpty, { statusCode: 200 })
|
||||
@OpenAPI({ description: "Create blank cards in bulk. <br> Just provide the count as a query param and wait for the 200 response." })
|
||||
async postBlancoBulk(@QueryParam("count") count: number) {
|
||||
let createPromises = new Array<any>();
|
||||
for (let index = 0; index < count; index++) {
|
||||
createPromises.push(this.cardRepository.save({ runner: null, enabled: true }))
|
||||
}
|
||||
await Promise.all(createPromises);
|
||||
let response = new ResponseEmpty();
|
||||
response.response = `Created ${count} new blanco cards.`
|
||||
return response;
|
||||
}
|
||||
|
||||
@Post()
|
||||
@Authorized("CARD:CREATE")
|
||||
@ResponseSchema(ResponseRunnerCard)
|
||||
|
|
|
@ -148,4 +148,27 @@ describe('POST /api/cards successfully (with runner)', () => {
|
|||
"responseType": "RUNNERCARD"
|
||||
});
|
||||
});
|
||||
});
|
||||
// ---------------
|
||||
describe('POST /api/cards/bulk successfully', () => {
|
||||
it('creating a single new bulk card should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/cards/bulk?count=1', {}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
});
|
||||
it('creating 50 new bulk card should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/cards/bulk?count=50', {}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
});
|
||||
it('creating 250 new bulk card should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/cards/bulk?count=250', {}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
});
|
||||
it('creating 2000 new bulk card should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/cards/bulk?count=2000', {}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue