Restructure

This commit is contained in:
Geomitron
2023-11-27 18:53:09 -06:00
parent 558d76f582
commit 49c3f38f99
758 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { VersionResult } from '../../shared/interfaces/songDetails.interface'
import { IPCInvokeHandler } from '../../shared/IPCHandler'
import { serverURL } from '../../shared/Paths'
/**
* Handles the 'song-details' event.
*/
class SongDetailsHandler implements IPCInvokeHandler<'song-details'> {
event = 'song-details' as const
/**
* @returns the chart versions with `songID`.
*/
async handler(songID: number): Promise<VersionResult[]> {
const response = await fetch(`https://${serverURL}/api/data/song-versions/${songID}`)
return await response.json()
}
}
export const songDetailsHandler = new SongDetailsHandler()