From 379d4d4fc5c0779471a02c4a3ebe54fef6b5e98c Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Tue, 7 Jan 2025 14:57:32 -0500 Subject: [PATCH] Also validate complex form types on updates --- backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs | 1 + backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs b/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs index 80eebd829..5599c0b91 100644 --- a/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs +++ b/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs @@ -429,6 +429,7 @@ public Task UpdateComplexFormType(Guid id, UpdateObjectInput UpdateComplexFormType(ComplexFormType before, ComplexFormType after) { + await validators.ValidateAndThrow(after); await ComplexFormTypeSync.Sync(before, after, this); return ToComplexFormType(ComplexFormTypesFlattened.Single(c => c.Guid == after.Id)); } diff --git a/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs b/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs index 44fa6fcd0..3663434ff 100644 --- a/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs +++ b/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs @@ -192,6 +192,7 @@ public async Task UpdateComplexFormType(Guid id, UpdateObjectIn public async Task UpdateComplexFormType(ComplexFormType before, ComplexFormType after) { + await validators.ValidateAndThrow(after); await ComplexFormTypeSync.Sync(before, after, this); return await GetComplexFormType(after.Id) ?? throw new NullReferenceException($"unable to find complex form type with id {after.Id}"); }