Skip to content

Commit 23b7d15

Browse files
committed
Fix import result responses
1 parent 1da34d1 commit 23b7d15

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

src/backend/app/Services/ImportServices/ApplianceImportService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private function importAppliance(array $applianceData): array {
133133
'appliance' => [
134134
'id' => $appliance->id,
135135
'name' => $appliance->name,
136+
'action' => $isNew ? 'added' : 'modified',
136137
],
137138
];
138139
}

src/backend/app/Services/ImportServices/ClusterImportService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ private function importCluster(array $clusterData): array {
165165
'cluster' => [
166166
'id' => $cluster->id,
167167
'name' => $cluster->name,
168+
'action' => $isNew ? 'added' : 'modified',
168169
],
169170
];
170171
}

src/backend/app/Services/ImportServices/CustomerImportService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ private function importCustomer(array $customerData): array {
188188
'id' => $person->id,
189189
'name' => $person->name,
190190
'surname' => $person->surname,
191+
'action' => $isNew ? 'added' : 'modified',
191192
],
192193
];
193194
}

src/backend/app/Services/ImportServices/DeviceImportService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ private function importDevice(array $deviceData): array {
157157
'id' => $existingDevice->id,
158158
'serial_number' => $existingDevice->device_serial,
159159
'type' => $existingDevice->device_type,
160+
'action' => 'modified',
160161
],
161162
];
162163
}
@@ -181,6 +182,7 @@ private function importDevice(array $deviceData): array {
181182
'id' => $device->id,
182183
'serial_number' => $device->device_serial,
183184
'type' => $device->device_type,
185+
'action' => 'added',
184186
],
185187
];
186188
}

src/backend/app/Services/ImportServices/TransactionImportService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ private function importTransaction(array $transactionData): array {
136136
'id' => $existingTransaction->id,
137137
'amount' => $existingTransaction->amount,
138138
'device_serial' => $deviceSerial,
139+
'action' => 'modified',
139140
],
140141
];
141142
}
@@ -162,6 +163,7 @@ private function importTransaction(array $transactionData): array {
162163
'id' => $transaction->id,
163164
'amount' => $transaction->amount,
164165
'device_serial' => $deviceSerial,
166+
'action' => 'added',
165167
],
166168
];
167169
}

src/backend/app/Services/ImportServices/UserPermissionImportService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ private function importUser(array $userData): array {
242242
'name' => $user->name,
243243
'email' => $user->email,
244244
'company_id' => $user->company_id,
245+
'action' => $isNew ? 'added' : 'modified',
245246
],
246247
];
247248
}

0 commit comments

Comments
 (0)