refactor(server)!: drop empty string to null conversion (#28808)

refactor(server): drop empty string to null conversion
This commit is contained in:
Timon
2026-06-04 00:16:53 +02:00
committed by GitHub
parent 137687bc0f
commit 5c33eb3204
9 changed files with 26 additions and 98 deletions
@@ -53,16 +53,6 @@ describe(PersonController.name, () => {
await request(ctx.getHttpServer()).post('/people');
expect(ctx.authenticate).toHaveBeenCalled();
});
it('should map an empty birthDate to null', async () => {
await request(ctx.getHttpServer()).post('/people').send({ birthDate: '' });
expect(service.create).toHaveBeenCalledWith(undefined, { birthDate: null });
});
it('should map an empty color to null', async () => {
await request(ctx.getHttpServer()).post('/people').send({ color: '' });
expect(service.create).toHaveBeenCalledWith(undefined, { color: null });
});
});
describe('DELETE /people', () => {
@@ -153,12 +143,6 @@ describe(PersonController.name, () => {
);
});
it('should map an empty birthDate to null', async () => {
const id = factory.uuid();
await request(ctx.getHttpServer()).put(`/people/${id}`).send({ birthDate: '' });
expect(service.update).toHaveBeenCalledWith(undefined, id, { birthDate: null });
});
it('should not accept an invalid birth date (false)', async () => {
const { status, body } = await request(ctx.getHttpServer())
.put(`/people/${factory.uuid()}`)