back fix
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
This commit is contained in:
parent
17f74cc613
commit
958bedf65a
1 changed files with 4 additions and 3 deletions
|
|
@ -377,10 +377,11 @@ class UserDao extends DatabaseAccessor<AppDatabase> with _$UserDaoMixin {
|
||||||
/// Проверить, есть ли у пользователя доступ к паку
|
/// Проверить, есть ли у пользователя доступ к паку
|
||||||
Future<bool> hasPackAccess(String userId, String packId) async {
|
Future<bool> hasPackAccess(String userId, String packId) async {
|
||||||
final query = select(userPacks)
|
final query = select(userPacks)
|
||||||
..where((up) => up.userId.equals(userId) & up.packId.equals(packId));
|
..where((up) => up.userId.equals(userId) & up.packId.equals(packId))
|
||||||
|
..limit(1);
|
||||||
|
|
||||||
final result = await query.getSingleOrNull();
|
final results = await query.get();
|
||||||
return result != null;
|
return results.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Дать пользователю доступ к паку
|
/// Дать пользователю доступ к паку
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue