Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Replace missed references to device_schema_version_id
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGodbehere committed Sep 29, 2023
1 parent 74914a2 commit f264d29
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/OriginMapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function update(UpdateDeviceOriginMapRequest $request, Device $device)
}

// Get the deviceSchemaVersion
$deviceSchemaVersion = DeviceSchemaVersion::where('id', $validated['device_schema_version_id'])->first();
$deviceSchemaVersion = DeviceSchemaVersion::where('schema_uuid', $validated['schema_uuid'])->first();
if (! $deviceSchemaVersion) {
throw new ActionFailException(
'The device schema version does not exist.', 404
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/UpdateDeviceOriginMapRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function rules()
'configuration' => 'required|json',
'activate' => 'required|boolean',
'device_schema_id' => 'required|exists:device_schemas,id',
'device_schema_version_id' => 'required|exists:device_schema_versions,id',
'schema_uuid' => 'required|exists:device_schema_versions,schema_uuid',
];
}
}
8 changes: 4 additions & 4 deletions resources/js/components/Devices/DeviceEditorOriginMapTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default {
url: this.device.latest_origin_map.schema_version.schema.url + '-v' +
this.device.latest_origin_map.schema_version.version + '.json',
device_schema_id: this.device.latest_origin_map.schema_version.device_schema_id,
device_schema_version_id: this.device.latest_origin_map.device_schema_version_id,
schema_uuid: this.device.latest_origin_map.schema_uuid,
}
this.refParser.dereference(schemaObj.url, (err, parsedSchema) => {
if (err) {
Expand Down Expand Up @@ -588,7 +588,7 @@ export default {
this.schemaBrowserVisible = false
this.schema = schema.parsedSchema
this.selectedSchemaId = schema.schemaObj.device_schema_id
this.selectedSchemaVersionId = schema.schemaObj.device_schema_version_id
this.selectedSchemaUUID = schema.schemaObj.schema_uuid
this.loadingExistingConfig = false
},

Expand All @@ -604,7 +604,7 @@ export default {
'configuration': JSON.stringify(this.model),
'activate': activate,
'device_schema_id': this.selectedSchemaId,
'device_schema_version_id': this.selectedSchemaVersionId,
'schema_uuid': this.selectedSchemaUUID,
}).then(() => {
this.loading = false
this.isDirty = false
Expand Down Expand Up @@ -642,7 +642,7 @@ export default {
schemaBrowserVisible: false,
schema: null,
selectedSchemaId: null,
selectedSchemaVersionId: null,
selectedSchemaUUID: null,
showCDSImport: false,
controls: [],

Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/Schemas/SchemaBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
this.$emit('selected', {
url: this.selectedDeviceSchema.url + '-v' + deviceSchemaVersion.version + '.json',
device_schema_id: this.selectedDeviceSchema.id,
device_schema_version_id: deviceSchemaVersion.id
schema_uuid: deviceSchemaVersion.schema_uuid
});
},
},
Expand Down

0 comments on commit f264d29

Please sign in to comment.