fix: POST the scrobble payload instead of GET

This commit is contained in:
Lei Nelissen
2023-06-13 23:33:23 +02:00
parent 6c9962f85a
commit 3650a0fede

View File

@@ -293,11 +293,14 @@ export async function sendPlaybackEvent(path: string, credentials: Credentials)
// Generate a config from the credentials and dispatch the request // Generate a config from the credentials and dispatch the request
const config = generateConfig(credentials); const config = generateConfig(credentials);
await fetch(`${credentials?.uri}${path}`, { await fetch(`${credentials?.uri}${path}`, {
method: 'POST',
headers: { headers: {
...config.headers, ...config.headers,
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
body: JSON.stringify(payload), body: JSON.stringify(payload),
// Swallow and errors from the request // Swallow and errors from the request
}).catch(() => {}); }).catch((err) => {
console.error(err);
});
} }