feat: Cleans up routes.
This commit is contained in:
@@ -92,10 +92,8 @@ extension Vendor.Create {
|
||||
|
||||
extension Vendor.Update {
|
||||
func validate() throws {
|
||||
if let name {
|
||||
guard !name.isEmpty else {
|
||||
throw ValidationError(message: "Vendor name should not be empty.")
|
||||
}
|
||||
guard !name.isEmpty else {
|
||||
throw ValidationError(message: "Vendor name should not be empty.")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,8 +139,6 @@ final class VendorModel: Model, @unchecked Sendable {
|
||||
|
||||
func applyUpdates(_ updates: Vendor.Update) throws {
|
||||
try updates.validate()
|
||||
if let name = updates.name {
|
||||
self.name = name
|
||||
}
|
||||
name = updates.name
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user