Compare commits
No commits in common. "879ad14c2a670b15f8b4868b7119be28d47e8141" and "099d336f7f85cef220906a43111e1e2491f80fde" have entirely different histories.
879ad14c2a
...
099d336f7f
@ -14,13 +14,10 @@ import GroupsTable from '@/app/ui/groups/table';
|
||||
import SkeletonTable from '@/app/ui/guests/skeleton-row';
|
||||
import GuestsTable from '@/app/ui/guests/table';
|
||||
import { TabPanel, TabView } from 'primereact/tabview';
|
||||
import { Toast } from 'primereact/toast';
|
||||
import { Suspense, useRef, useState } from 'react';
|
||||
import { Suspense, useState } from 'react';
|
||||
|
||||
|
||||
export default function Page() {
|
||||
const toast = useRef<Toast>(null);
|
||||
|
||||
function refreshGuests() {
|
||||
new AbstractApi<Guest>().getAll(new GuestSerializer(), (objects: Guest[]) => {
|
||||
setGuests(objects);
|
||||
@ -43,24 +40,6 @@ export default function Page() {
|
||||
'X-CSRF-TOKEN': getCsrfToken(),
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
showAffinitiesResetSuccess();
|
||||
} else {
|
||||
console.error('Failed to reset affinities');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error resetting affinities:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function showAffinitiesResetSuccess() {
|
||||
toast.current?.show({
|
||||
severity: 'success',
|
||||
summary: 'Affinities reset',
|
||||
detail: 'All affinities have been reset to default values.'
|
||||
});
|
||||
}
|
||||
|
||||
const [groupsLoaded, setGroupsLoaded] = useState(false);
|
||||
@ -103,7 +82,6 @@ export default function Page() {
|
||||
<div className="flex flex-col w-full items-center justify-between">
|
||||
|
||||
<div>
|
||||
<Toast ref={toast} />
|
||||
<button onClick={() => setGroupBeingEdited({})} className={classNames('primary')}>Add new</button>
|
||||
<button onClick={resetAffinities} className={classNames('yellow')}>Reset affinities</button>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user