aboutsummaryrefslogtreecommitdiff
path: root/modern/src/PositionPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/PositionPage.js')
-rw-r--r--modern/src/PositionPage.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/modern/src/PositionPage.js b/modern/src/PositionPage.js
index 37b0145f..08502668 100644
--- a/modern/src/PositionPage.js
+++ b/modern/src/PositionPage.js
@@ -29,14 +29,12 @@ const PositionPage = () => {
useEffectAsync(async () => {
if (id) {
- const response = await fetch(`/api/positions?id=${id}`, {
- headers: {
- Accept: 'application/json',
- },
- });
+ const response = await fetch(`/api/positions?id=${id}`);
if (response.ok) {
- const items = await response.json();
- setItem(items[0]);
+ const positions = await response.json();
+ if (positions.length > 0) {
+ setItem(positions[0]);
+ }
}
} else {
setItem({});