Skip to content

Commit

Permalink
return empty array when no avail is found
Browse files Browse the repository at this point in the history
  • Loading branch information
mogii committed Mar 13, 2024
1 parent fce4da1 commit 640ea4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ class Plugin {
}/`,
headers,
}));
if (!avail) return { fields: [] };
if (!(avail && avail.pk)) return { fields: [], customFields: [] };
const detailedAvail = R.path(['data', 'availability'], await axios({
url: `${endpoint || this.endpoint}/${shortName.trim()}/availabilities/${avail.pk}/`,
method: 'get',
Expand Down

0 comments on commit 640ea4a

Please sign in to comment.