[#77] added tests and fixed bug

This commit is contained in:
Camille Moussu
2025-09-05 12:36:58 +02:00
parent 6de3280851
commit 8efeea8102
5 changed files with 358 additions and 13 deletions
+6 -4
View File
@@ -32,10 +32,12 @@ export default function UserSearch({
useEffect(() => {
const delayDebounceFn = setTimeout(async () => {
setLoading(true);
const res = await searchUsers(query);
setOptions(res);
setLoading(false);
if (query) {
setLoading(true);
const res = await searchUsers(query);
setOptions(res);
setLoading(false);
}
}, 300);
return () => clearTimeout(delayDebounceFn);
+4 -4
View File
@@ -171,8 +171,8 @@ export default function RepeatEvent({
value={repetition.occurrences ?? 0}
onChange={(e) =>
setRepetition({
freq: repetition.freq,
interval: repetition.interval,
...repetition,
endDate: "",
occurrences: Number(e.target.value),
})
}
@@ -197,8 +197,8 @@ export default function RepeatEvent({
value={repetition.endDate ?? ""}
onChange={(e) =>
setRepetition({
freq: repetition.freq,
interval: repetition.interval,
...repetition,
occurrences: 0,
endDate: e.target.value,
})
}
-3
View File
@@ -84,9 +84,7 @@ export function parseCalendarEvent(
break;
case "rrule":
event.repetition = { freq: value.freq.toLowerCase() };
console.log(value);
if (value.byday) {
console.log(value.byday);
event.repetition.selectedDays = value.byday;
}
if (value.until) {
@@ -98,7 +96,6 @@ export function parseCalendarEvent(
if (value.interval) {
event.repetition.interval = value.interval;
}
console.log(event.repetition);
break;
}
}