fix(MessageEntriesModal): automatically load all pages
Build and Push Docker image / build-and-push (push) Successful in 5m15s
Details
Build and Push Docker image / build-and-push (push) Successful in 5m15s
Details
This commit is contained in:
parent
329b5ba5ff
commit
90e30ed1ae
|
@ -70,7 +70,7 @@ export default function Announcement({announcement}: {
|
|||
{", Zeitslot "}
|
||||
{pprintDateRange(entry.slotStartDate, entry.slotEndDate)}
|
||||
{", "}
|
||||
{humanDeltaFromNow(entry.created).message}
|
||||
{humanDeltaFromNow(entry.slotStartDate).message}
|
||||
</List.Item>
|
||||
))}
|
||||
</List>
|
||||
|
|
|
@ -9,6 +9,7 @@ import TextEditor from "@/components/input/Editor";
|
|||
import ListSelect from "@/pages/events/e/:eventId/EventLists/ListSelect.tsx";
|
||||
import {showSuccessNotification} from "@/components/util.tsx";
|
||||
import {usePB} from "@/lib/pocketbase.tsx";
|
||||
import {useEffect} from "react";
|
||||
|
||||
|
||||
export default function MessageEntriesModal({opened, event, onClose, query}: {
|
||||
|
@ -34,11 +35,18 @@ export default function MessageEntriesModal({opened, event, onClose, query}: {
|
|||
selectedLists: [] as EventListModel[],
|
||||
},
|
||||
validate: {
|
||||
subject: hasLength({max: 255}, "Der Betreff ist zu lang"),
|
||||
content: hasLength({min: 10, max: 5000}, "Die Nachricht muss zwischen 10 und 5000 Zeichen lang sein"),
|
||||
subject: hasLength({max: 255}, "Der Betreff ist zu lang (max. 255 Zeichen)"),
|
||||
content: hasLength({min: 10, max: 10000}, "Die Nachricht muss zwischen 10 und 10000 Zeichen lang sein"),
|
||||
}
|
||||
})
|
||||
|
||||
// Fetch all pages
|
||||
useEffect(() => {
|
||||
if (opened && query.hasNextPage && !query.isFetchingNextPage) {
|
||||
query.fetchNextPage()
|
||||
}
|
||||
}, [opened, query])
|
||||
|
||||
const mutation = useMutation({
|
||||
mutationFn: async () => {
|
||||
await pb.collection("messages").create({
|
||||
|
|
Loading…
Reference in New Issue