(collection: CharacterCollection)
| 223 | } |
| 224 | |
| 225 | export async function saveCharacterCollection(collection: CharacterCollection): Promise<void> { |
| 226 | localStorage.setItem(STORAGE_KEY, JSON.stringify(collection)); |
| 227 | try { |
| 228 | await fetch(CHARACTER_API, { |
| 229 | method: 'POST', |
| 230 | headers: { 'Content-Type': 'application/json' }, |
| 231 | body: JSON.stringify(collection), |
| 232 | }); |
| 233 | } catch (e) { |
| 234 | console.warn('[CharacterManager] saveCharacterCollection failed:', e); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | // --------------------------------------------------------------------------- |
| 239 | // Collection helpers |
no test coverage detected