[FE][Certs] Refresh register list on add
This commit is contained in:
parent
3734c49084
commit
b458eeedd2
@ -5,10 +5,13 @@ import { Register } from "../../types/Register";
|
||||
import { courseMap } from "../../utils/allCourses";
|
||||
import { certGenerator } from "../../certGenerator";
|
||||
|
||||
export function Registers(props: {person: Person | null}) {
|
||||
export function Registers(props: {person: Person | null, count: number}) {
|
||||
const [registers, setRegisters] = createSignal<Array<Register>>([]);
|
||||
|
||||
createEffect(async() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const _count = props.count;
|
||||
|
||||
if (props.person === null) {
|
||||
setRegisters([]);
|
||||
return;
|
||||
|
@ -6,12 +6,16 @@ import { Person } from "../types/Person";
|
||||
|
||||
export function Certs() {
|
||||
const [person, setPerson] = createSignal<Person | null>(null);
|
||||
const [count, setCount] = createSignal(0);
|
||||
|
||||
return (
|
||||
<div class="grid grid-cols-[16rem_25rem_1fr]">
|
||||
<Search setPerson={setPerson} />
|
||||
<NewRegister personId={person()?.person_id ?? -1} onSuccess={() => {}} />
|
||||
<Registers person={person()} />
|
||||
<NewRegister
|
||||
personId={person()?.person_id ?? -1}
|
||||
onSuccess={() => setCount((x) => x + 1)}
|
||||
/>
|
||||
<Registers person={person()} count={count()} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user