mirror of
https://github.com/idanoo/autobrr
synced 2025-07-24 01:09:13 +00:00
fix(indexes): toggle on and off with switch (#1164)
* chore(indexers): replace array position with id * fix(indexers): enable and disable without editing * feat(indexer): add toggle endpoint and refactoring --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
603191b47d
commit
8600d3a2ab
7 changed files with 167 additions and 50 deletions
|
@ -240,13 +240,16 @@ export const APIClient = {
|
|||
create: (indexer: Indexer) => appClient.Post<Indexer>("api/indexer", {
|
||||
body: indexer
|
||||
}),
|
||||
update: (indexer: Indexer) => appClient.Put("api/indexer", {
|
||||
update: (indexer: Indexer) => appClient.Put(`api/indexer/${indexer.id}`, {
|
||||
body: indexer
|
||||
}),
|
||||
delete: (id: number) => appClient.Delete(`api/indexer/${id}`),
|
||||
testApi: (req: IndexerTestApiReq) => appClient.Post<IndexerTestApiReq>(`api/indexer/${req.id}/api/test`, {
|
||||
body: req
|
||||
})
|
||||
}),
|
||||
toggleEnable: (id: number, enabled: boolean) => appClient.Patch(`api/indexer/${id}/enabled`, {
|
||||
body: { enabled }
|
||||
}),
|
||||
},
|
||||
irc: {
|
||||
getNetworks: () => appClient.Get<IrcNetworkWithHealth[]>("api/irc"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue