mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 20:40:15 +02:00
fix list filters
This commit is contained in:
@@ -2,12 +2,9 @@ import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Select, SelectProps } from '/@/shared/components/select/select';
|
||||
|
||||
export interface YesNoSelectProps extends Omit<SelectProps, 'data' | 'onChange' | 'value'> {
|
||||
onChange: (e?: boolean) => void;
|
||||
value?: boolean;
|
||||
}
|
||||
export interface YesNoSelectProps extends SelectProps {}
|
||||
|
||||
export const YesNoSelect = ({ onChange, value, ...props }: YesNoSelectProps) => {
|
||||
export const YesNoSelect = ({ ...props }: YesNoSelectProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -23,10 +20,6 @@ export const YesNoSelect = ({ onChange, value, ...props }: YesNoSelectProps) =>
|
||||
value: 'true',
|
||||
},
|
||||
]}
|
||||
onChange={(e) => {
|
||||
onChange(e ? e === 'true' : undefined);
|
||||
}}
|
||||
value={value !== undefined ? value.toString() : null}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1224,7 +1224,7 @@ export type ControllerEndpoint = {
|
||||
getSongListCount: (args: SongListCountArgs) => Promise<number>;
|
||||
getStreamUrl: (args: StreamArgs) => string;
|
||||
getStructuredLyrics?: (args: StructuredLyricsArgs) => Promise<StructuredLyric[]>;
|
||||
getTags?: (args: TagArgs) => Promise<TagResponses>;
|
||||
getTags?: (args: TagArgs) => Promise<TagsResponse>;
|
||||
getTopSongs: (args: TopSongListArgs) => Promise<TopSongListResponse>;
|
||||
getUserList?: (args: UserListArgs) => Promise<UserListResponse>;
|
||||
movePlaylistItem?: (args: MoveItemArgs) => Promise<void>;
|
||||
@@ -1316,7 +1316,7 @@ export type InternalControllerEndpoint = {
|
||||
getStructuredLyrics?: (
|
||||
args: ReplaceApiClientProps<StructuredLyricsArgs>,
|
||||
) => Promise<StructuredLyric[]>;
|
||||
getTags?: (args: ReplaceApiClientProps<TagArgs>) => Promise<TagResponses>;
|
||||
getTags?: (args: ReplaceApiClientProps<TagArgs>) => Promise<TagsResponse>;
|
||||
getTopSongs: (args: ReplaceApiClientProps<TopSongListArgs>) => Promise<TopSongListResponse>;
|
||||
getUserList?: (args: ReplaceApiClientProps<UserListArgs>) => Promise<UserListResponse>;
|
||||
movePlaylistItem?: (args: ReplaceApiClientProps<MoveItemArgs>) => Promise<void>;
|
||||
@@ -1408,8 +1408,9 @@ export type StructuredUnsyncedLyric = Omit<FullLyricsMetadata, 'lyrics'> & {
|
||||
};
|
||||
|
||||
export type Tag = {
|
||||
id: string;
|
||||
name: string;
|
||||
options: string[];
|
||||
options: { id: string; name: string }[];
|
||||
};
|
||||
|
||||
export type TagArgs = BaseEndpointArgs & {
|
||||
@@ -1421,9 +1422,13 @@ export type TagQuery = {
|
||||
type: LibraryItem.ALBUM | LibraryItem.SONG;
|
||||
};
|
||||
|
||||
export type TagResponses = {
|
||||
export type TagsResponse = {
|
||||
boolTags?: string[];
|
||||
enumTags?: Tag[];
|
||||
enumTags?: { name: string; options: { id: string; name: string }[] }[];
|
||||
excluded: {
|
||||
album: string[];
|
||||
song: string[];
|
||||
};
|
||||
};
|
||||
|
||||
type BaseEndpointArgsWithServer = {
|
||||
|
||||
Reference in New Issue
Block a user