Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041import {createApi, fetchBaseQuery} from "@reduxjs/toolkit/query/react";
export const sourceApi = createApi({ reducerPath: 'sourceApi', baseQuery: fetchBaseQuery({baseUrl: '/api/'}), endpoints: (builder) => ({ startSource: builder.mutation<undefined, { name: string, type: string, force?: boolean }>({ query: (params) => ({ url: '/source/init', method: 'POST', params: { name: params.name, type: params.type, force: params.force } }) }), listenSource: builder.mutation<undefined, { name: string, type: string, listening?: boolean }>({ query: (params) => ({ url: '/source/listen', method: 'POST', params: { name: params.name, type: params.type, listening: params.listening } }) }) })});
export const {useStartSourceMutation, useListenSourceMutation} = sourceApi;