| Class: | Api.Auth.Queries.RegisterInfo |
|---|---|
| Assembly: | Api |
| File(s): | /home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/Auth/Queries/RegisterInfo.cs |
| Covered lines: | 1 |
|---|---|
| Uncovered lines: | 0 |
| Coverable lines: | 1 |
| Total lines: | 19 |
| Line coverage: | 100% |
| Covered branches: | 0 |
|---|---|
| Total branches: | 0 |
| Branch coverage: | N/A |
Feature is only available for sponsors
Upgrade to PRO version| Method | Branch coverage | Crap Score | Cyclomatic complexity | Line coverage |
|---|---|---|---|---|
| .ctor(...) | 100% | 1 | 1 | 100% |
| # | Line | Line coverage | ||
|---|---|---|---|---|
1 | // SPDX-FileCopyrightText: 2026 Alper Çelik <[email protected]> | |||
2 | // | |||
3 | // SPDX-License-Identifier: AGPL-3.0-or-later | |||
4 | | |||
5 | using Api.Database; | |||
6 | using HotChocolate.Authorization; | |||
7 | using static Api.Auth.Utils.AuthUtils; | |||
8 | | |||
9 | namespace Api.Auth.Queries; | |||
10 | | |||
| 1 | 11 | public record RegisterInfo(bool CanRegisterAsAdmin); | ||
12 | | |||
13 | [QueryType] | |||
14 | public partial class RegisterInfoQueries | |||
15 | { | |||
16 | [AllowAnonymous] | |||
17 | public static async Task<RegisterInfo> GetRegisterInfoAsync([Service] PGContext db) => | |||
18 | new(CanRegisterAsAdmin: await CanAdminRegister(db)); | |||
19 | } |