V1.14.1: choose where a new encounter goes
- A new encounter, battle or quest, goes to the bottom of the campaign's encounter list. It used to go to the top. - A menu beside the name when adding one says where it goes instead: at the bottom, at the top, or straight after any encounter on the list. Top or bottom is remembered per browser. - All packages at version 1.14.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -735,7 +735,8 @@ export function useCampaignEncounters(campaignId: string | undefined) {
|
||||
export function useCreateEncounter(campaignId: string) {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async (data: { name: string; mode?: EncounterMode }) =>
|
||||
// Where it goes in the campaign's order: the top, the bottom (the default), or straight after another.
|
||||
mutationFn: async (data: { name: string; mode?: EncounterMode; position?: 'TOP' | 'BOTTOM'; afterEncounterId?: string }) =>
|
||||
(await apiClient.post<{ encounter: Encounter }>(`/campaigns/${campaignId}/encounters`, data)).data.encounter,
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['campaign', campaignId, 'encounters'] }),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user