Skip to content

Commit

Permalink
feat: added default updated at in new shelter to avoid null field in … (
Browse files Browse the repository at this point in the history
  • Loading branch information
fagundesjg authored and filipepacheco committed May 14, 2024
1 parent 2954d7a commit 1a0fcad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shelter/shelter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
FullUpdateShelterSchema,
UpdateShelterSchema,
} from './types/types';
import { subDays } from 'date-fns';

@Injectable()
export class ShelterService {
Expand All @@ -30,6 +31,7 @@ export class ShelterService {
data: {
...payload,
createdAt: new Date().toISOString(),
updatedAt: subDays(new Date(), 1).toISOString(),
},
});
}
Expand Down

0 comments on commit 1a0fcad

Please sign in to comment.