-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: implement search functionality compatible with pagination
server: search gives just one page size and is case insensitive
- Loading branch information
1 parent
2abe1c0
commit d9d9351
Showing
11 changed files
with
133 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<div class="flex flex-col gap-x-4 gap-y-2 sm:flex-row"> | ||
<FormInput | ||
id="track_title" | ||
class="w-full" | ||
type="text" | ||
@input="input_track" | ||
:icon="MusicalNoteIcon" | ||
placeholder="Search by track title..." | ||
/> | ||
<FormInput | ||
id="artist_name" | ||
class="w-full" | ||
type="text" | ||
@input="input_artist" | ||
:icon="UserIcon" | ||
placeholder="Search by artist name..." | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { MusicalNoteIcon, UserIcon } from '@heroicons/vue/24/outline'; | ||
export default defineComponent({ | ||
setup() { | ||
return { | ||
artist_name: ref<string>(''), | ||
track_title: ref<string>(''), | ||
}; | ||
}, | ||
emits: ['search_query'], | ||
methods: { | ||
MusicalNoteIcon, | ||
UserIcon, | ||
emit_search_query() { | ||
this.$emit('search_query', { | ||
artist_name: this.artist_name.length >= 3 ? this.artist_name : '', | ||
track_title: this.track_title.length >= 3 ? this.track_title : '', | ||
}); | ||
}, | ||
input_track(event: InputEvent) { | ||
this.track_title = event.target?.value; | ||
this.emit_search_query(); | ||
}, | ||
input_artist(event: InputEvent) { | ||
this.artist_name = event.target?.value; | ||
this.emit_search_query(); | ||
}, | ||
}, | ||
}); | ||
</script> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<p | ||
class="w-full rounded-md bg-secondary-100 p-10 text-center text-xl italic dark:bg-secondary-900" | ||
> | ||
<slot /> | ||
</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters