mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-19 18:04:22 +02:00
Set owner field edit to Navidrome only (#327)
This commit is contained in:
@@ -71,6 +71,7 @@ export const UpdatePlaylistForm = ({ users, query, body, onCancel }: UpdatePlayl
|
|||||||
});
|
});
|
||||||
|
|
||||||
const isPublicDisplayed = server?.type === ServerType.NAVIDROME;
|
const isPublicDisplayed = server?.type === ServerType.NAVIDROME;
|
||||||
|
const isOwnerDisplayed = server?.type === ServerType.NAVIDROME;
|
||||||
const isSubmitDisabled = !form.values.name || mutation.isLoading;
|
const isSubmitDisabled = !form.values.name || mutation.isLoading;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -86,11 +87,13 @@ export const UpdatePlaylistForm = ({ users, query, body, onCancel }: UpdatePlayl
|
|||||||
label="Description"
|
label="Description"
|
||||||
{...form.getInputProps('comment')}
|
{...form.getInputProps('comment')}
|
||||||
/>
|
/>
|
||||||
<Select
|
{isOwnerDisplayed && (
|
||||||
data={userList || []}
|
<Select
|
||||||
{...form.getInputProps('_custom.navidrome.ownerId')}
|
data={userList || []}
|
||||||
label="Owner"
|
{...form.getInputProps('_custom.navidrome.ownerId')}
|
||||||
/>
|
label="Owner"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{isPublicDisplayed && (
|
{isPublicDisplayed && (
|
||||||
<Switch
|
<Switch
|
||||||
label="Is Public?"
|
label="Is Public?"
|
||||||
@@ -132,11 +135,14 @@ export const openUpdatePlaylistModal = async (args: {
|
|||||||
|
|
||||||
if (!server) return;
|
if (!server) return;
|
||||||
|
|
||||||
const users = await queryClient.fetchQuery({
|
const users =
|
||||||
queryFn: ({ signal }) =>
|
server?.type === ServerType.NAVIDROME
|
||||||
api.controller.getUserList({ apiClientProps: { server, signal }, query }),
|
? await queryClient.fetchQuery({
|
||||||
queryKey: queryKeys.users.list(server?.id || '', query),
|
queryFn: ({ signal }) =>
|
||||||
});
|
api.controller.getUserList({ apiClientProps: { server, signal }, query }),
|
||||||
|
queryKey: queryKeys.users.list(server?.id || '', query),
|
||||||
|
})
|
||||||
|
: null;
|
||||||
|
|
||||||
openModal({
|
openModal({
|
||||||
children: (
|
children: (
|
||||||
|
|||||||
Reference in New Issue
Block a user