Make all fields optional on entities (#121)

* Make all fields optional on entities

* Rewrite tests

* Add test on TableHeader Cancel button
This commit is contained in:
Charles Bochet
2023-05-17 14:50:49 +02:00
committed by GitHub
parent 2facb383a2
commit bc49815ff0
31 changed files with 541 additions and 419 deletions

View File

@ -8,7 +8,7 @@ import {
availableSorts,
usePeopleColumns,
} from './people-table';
import { Person, mapPerson } from '../../interfaces/person.interface';
import { Person, mapToPerson } from '../../interfaces/person.interface';
import { useCallback, useEffect, useRef, useState } from 'react';
import {
PeopleSelectedSortType,
@ -58,7 +58,7 @@ function People() {
useEffect(() => {
if (!loading) {
if (data) {
setInternalData(data.people.map(mapPerson));
setInternalData(data.people.map(mapToPerson));
}
}
}, [loading, setInternalData, data]);
@ -71,7 +71,7 @@ function People() {
email: '',
phone: '',
company: null,
pipe: null,
pipes: [],
creationDate: new Date(),
city: '',
};