mirror of
https://github.com/sct/overseerr.git
synced 2025-12-27 00:34:56 +01: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();
|
||||
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.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user