mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 19:01:40 +00:00
Add owner to playlist update query
- Support smart playlist rules - Add user list query
This commit is contained in:
parent
75ef43dffb
commit
d63e5f5784
13 changed files with 309 additions and 59 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Group, Stack } from '@mantine/core';
|
||||
import { useForm } from '@mantine/form';
|
||||
import { CreatePlaylistQuery, ServerType } from '/@/renderer/api/types';
|
||||
import { CreatePlaylistBody, ServerType } from '/@/renderer/api/types';
|
||||
import { Button, Switch, TextInput, toast } from '/@/renderer/components';
|
||||
import { useCreatePlaylist } from '/@/renderer/features/playlists/mutations/create-playlist-mutation';
|
||||
import { useCurrentServer } from '/@/renderer/store';
|
||||
|
|
@ -13,18 +13,20 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
|||
const mutation = useCreatePlaylist();
|
||||
const server = useCurrentServer();
|
||||
|
||||
const form = useForm<CreatePlaylistQuery>({
|
||||
const form = useForm<CreatePlaylistBody>({
|
||||
initialValues: {
|
||||
comment: '',
|
||||
name: '',
|
||||
public: false,
|
||||
rules: undefined,
|
||||
ndParams: {
|
||||
public: false,
|
||||
rules: undefined,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const handleSubmit = form.onSubmit((values) => {
|
||||
mutation.mutate(
|
||||
{ query: values },
|
||||
{ body: values },
|
||||
{
|
||||
onError: (err) => {
|
||||
toast.error({ message: err.message, title: 'Error creating playlist' });
|
||||
|
|
@ -56,7 +58,7 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
|||
{isPublicDisplayed && (
|
||||
<Switch
|
||||
label="Is Public?"
|
||||
{...form.getInputProps('public')}
|
||||
{...form.getInputProps('ndParams.public')}
|
||||
/>
|
||||
)}
|
||||
<Group position="right">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue