API work on SongbookSongs
This commit is contained in:
1 parent
4bdf03426c
commit
b060ab29cf
10 files changed
+347
-119
No files matched your search
@@ -125,6 +125,9 @@ export async function searchSongsByTitle(query: string, limit: number = 20) {
|
||||
*/
|
||||
export async function createSong(data: { title: string }) {
|
||||
try{
|
||||
if(!data.title){
|
||||
return { success: false, status: 400, error: "Field 'title' is required" };
|
||||
}
|
||||
const song = await prisma.song.create({
|
||||
data: {
|
||||
title: data.title.trim()
|
||||
|
||||
Reference in new issue
Block a user