-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added CmsRepo to the CmsConfig
- Loading branch information
1 parent
a50c397
commit 909b0ee
Showing
8 changed files
with
70 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# 0.8.0 | ||
|
||
## Feat | ||
|
||
- BREAKING: Added `CmsRepo` to `CmsConfig` | ||
|
||
# 0.7.0 | ||
|
||
## Feat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:impaktfull_cms/impaktfull_cms.dart'; | ||
import 'package:impaktfull_cms_example/data/user.dart'; | ||
import 'package:impaktfull_cms_example/repo/user_repo.dart'; | ||
|
||
class CmsUserRepo extends CmsRepo<User, int> { | ||
@override | ||
Future<PagingInfo<User>> loadAll({ | ||
required int page, | ||
required int pageSize, | ||
}) async => | ||
UserRepo.instance.getUsers( | ||
page: page, | ||
pageSize: pageSize, | ||
); | ||
|
||
@override | ||
Future<User> load(int id) async => UserRepo.instance.getUser(id); | ||
|
||
@override | ||
Future<void> delete(User item) async => UserRepo.instance.delete(item); | ||
|
||
@override | ||
Future<User> save(User item) async => UserRepo.instance.save(item); | ||
|
||
@override | ||
Future<User> update(int id, User item) async => UserRepo.instance.update(item); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:impaktfull_cms/impaktfull_cms.dart'; | ||
|
||
/// | ||
abstract class CmsRepo<T, E> { | ||
Future<T> save(T item); | ||
|
||
Future<T> update(E id, T item); | ||
|
||
Future<void> delete(T item); | ||
|
||
Future<T> load(E id); | ||
|
||
Future<PagingInfo<T>> loadAll({ | ||
required int page, | ||
required int pageSize, | ||
}); | ||
} |