mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-18 09:24:19 +02:00
refactor api controller to internalize server fetch
This commit is contained in:
@@ -21,7 +21,7 @@ interface SaveAsPlaylistFormProps {
|
||||
body: Partial<CreatePlaylistBody>;
|
||||
onCancel: () => void;
|
||||
onSuccess: (data: CreatePlaylistResponse) => void;
|
||||
serverId: string | undefined;
|
||||
serverId?: string;
|
||||
}
|
||||
|
||||
export const SaveAsPlaylistForm = ({
|
||||
@@ -50,7 +50,7 @@ export const SaveAsPlaylistForm = ({
|
||||
|
||||
const handleSubmit = form.onSubmit((values) => {
|
||||
mutation.mutate(
|
||||
{ body: values, serverId },
|
||||
{ apiClientProps: { serverId: serverId || '' }, body: values },
|
||||
{
|
||||
onError: (err) => {
|
||||
toast.error({
|
||||
|
||||
Reference in New Issue
Block a user