From 2d6fdfbe8a025a09ce0d19b4409e1559ddda58a7 Mon Sep 17 00:00:00 2001 From: "thomashii@dukefirehawk.com" Date: Mon, 3 May 2021 21:49:19 +0800 Subject: [PATCH] Updates model --- .../lib/src/models/email_indexed.g.dart | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/orm/angel_orm_test/lib/src/models/email_indexed.g.dart b/packages/orm/angel_orm_test/lib/src/models/email_indexed.g.dart index d7988a82..af1ce54c 100644 --- a/packages/orm/angel_orm_test/lib/src/models/email_indexed.g.dart +++ b/packages/orm/angel_orm_test/lib/src/models/email_indexed.g.dart @@ -128,13 +128,13 @@ class RoleQuery extends Query { @override get(QueryExecutor executor) { return super.get(executor).then((result) { - return result.fold>([], (out, model) { - var idx = out.indexWhere((m) => m!.role == model!.role); + return result.fold>([], (out, model) { + var idx = out.indexWhere((m) => m.role == model!.role); if (idx == -1) { - return out..add(model); + return out..add(model!); } else { - var l = out[idx]!; + var l = out[idx]; return out ..[idx] = l.copyWith( users: List<_User?>.from(l.users ?? []) @@ -166,13 +166,13 @@ class RoleQuery extends Query { @override delete(QueryExecutor executor) { return super.delete(executor).then((result) { - return result.fold>([], (out, model) { - var idx = out.indexWhere((m) => m!.role == model!.role); + return result.fold>([], (out, model) { + var idx = out.indexWhere((m) => m.role == model!.role); if (idx == -1) { - return out..add(model); + return out..add(model!); } else { - var l = out[idx]!; + var l = out[idx]; return out ..[idx] = l.copyWith( users: List<_User?>.from(l.users ?? []) @@ -420,13 +420,13 @@ class UserQuery extends Query { @override update(QueryExecutor executor) { return super.update(executor).then((result) { - return result.fold>([], (out, model) { - var idx = out.indexWhere((m) => m!.email == model!.email); + return result.fold>([], (out, model) { + var idx = out.indexWhere((m) => m.email == model!.email); if (idx == -1) { - return out..add(model); + return out..add(model!); } else { - var l = out[idx]!; + var l = out[idx]; return out ..[idx] = l.copyWith( roles: List<_Role?>.from(l.roles ?? []) @@ -439,13 +439,13 @@ class UserQuery extends Query { @override delete(QueryExecutor executor) { return super.delete(executor).then((result) { - return result.fold>([], (out, model) { - var idx = out.indexWhere((m) => m!.email == model!.email); + return result.fold>([], (out, model) { + var idx = out.indexWhere((m) => m.email == model!.email); if (idx == -1) { - return out..add(model); + return out..add(model!); } else { - var l = out[idx]!; + var l = out[idx]; return out ..[idx] = l.copyWith( roles: List<_Role?>.from(l.roles ?? [])