(values)
| 495 | } |
| 496 | |
| 497 | static async addChannelGroup(values) { |
| 498 | try { |
| 499 | const response = await request(`${host}/api/channels/groups/`, { |
| 500 | method: 'POST', |
| 501 | body: values, |
| 502 | }); |
| 503 | |
| 504 | if (response.id) { |
| 505 | // Add association flags for new groups |
| 506 | const processedGroup = { |
| 507 | ...response, |
| 508 | hasChannels: false, |
| 509 | hasM3UAccounts: false, |
| 510 | canEdit: true, |
| 511 | canDelete: true, |
| 512 | }; |
| 513 | useChannelsStore.getState().addChannelGroup(processedGroup); |
| 514 | // Refresh channel groups to update the UI |
| 515 | useChannelsStore.getState().fetchChannelGroups(); |
| 516 | } |
| 517 | |
| 518 | return response; |
| 519 | } catch (e) { |
| 520 | errorNotification('Failed to create channel group', e); |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | static async updateChannelGroup(values) { |
| 525 | try { |
no test coverage detected