mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-02 12:48:45 -05:00
fix(ui): handle import-from-plex response as array (#1510)
This commit is contained in:
@@ -57,9 +57,9 @@ const PlexImportModal = ({ onCancel, onComplete }: PlexImportProps) => {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
if (!res.ok) throw new Error();
|
if (!res.ok) throw new Error();
|
||||||
const { data: createdUsers } = await res.json();
|
const createdUsers = await res.json();
|
||||||
|
|
||||||
if (!createdUsers.length) {
|
if (!Array.isArray(createdUsers) || createdUsers.length === 0) {
|
||||||
throw new Error('No users were imported from Plex.');
|
throw new Error('No users were imported from Plex.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user