yeah
This commit is contained in:
21
server/api/test/test-db-sync.post.ts
Normal file
21
server/api/test/test-db-sync.post.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { syncCardsWithDatabase } from '../../services/cardSync.service'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const config = useRuntimeConfig()
|
||||
const folderPath = config.pathFiles || process.env.PATH_FILES || 'mnt/media/files/music'
|
||||
|
||||
try {
|
||||
const result = await syncCardsWithDatabase(folderPath)
|
||||
|
||||
return {
|
||||
success: true,
|
||||
...result
|
||||
}
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
error: error.message,
|
||||
stack: error.stack
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user