fix: ordering when refetching applications

This commit is contained in:
Sebastian Pravda 2023-02-15 15:56:26 +01:00
parent c905effd92
commit c122c65a61
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57

View file

@ -20,7 +20,11 @@
const getCandidates = async () => {
try {
candidates = await apiListCandidates(undefined, {field: activeFilter.filter});
// TODO: more generic implementation
candidates = await apiListCandidates(
undefined,
activeFilter.filter !== undefined ? { field: activeFilter.filter } : undefined
);
} catch {
pushErrorText('Nepodařilo se načíst uchazeče');
}
@ -155,7 +159,11 @@
</div>
{/if}
<Table showCreatedAt={activeFilter.class === 'Chronologicky'} candidates={candidatesTable} on:delete={(event) => deleteCandidate(event.detail.id)} />
<Table
showCreatedAt={activeFilter.class === 'Chronologicky'}
candidates={candidatesTable}
on:delete={(event) => deleteCandidate(event.detail.id)}
/>
</div>
</div>
</div>