-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3554 Create missing chapters when adding draft to a project #3432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
SFProject project = await EnsureProjectPermissionAsync( | ||
curUserId, | ||
sfProjectId, | ||
isServalAdmin: false, | ||
cancellationToken | ||
); |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
project
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
To fix the problem, simply remove the assignment to the project
variable and instead await
the method directly as a statement. In src/SIL.XForge.Scripture/Services/MachineApiService.cs
, replace SFProject project = await EnsureProjectPermissionAsync(...);
with await EnsureProjectPermissionAsync(...);
. No further code changes are required since the result is never used. No changes to imports, method signatures, or additional definitions are needed.
-
Copy modified line R1178
@@ -1175,7 +1175,7 @@ | ||
) | ||
{ | ||
// Ensure that the user has permission | ||
SFProject project = await EnsureProjectPermissionAsync( | ||
await EnsureProjectPermissionAsync( | ||
curUserId, | ||
sfProjectId, | ||
isServalAdmin: false, |
Adding a draft to a book that is empty fails to create the missing chapters. We needed a way to detect how many chapters exist in the generated draft and notify the front end so that it can create the missing chapters and update the project texts property. This PR creates a new endpoint that can be used to get the chapters that have drafts.
This change is