Correctly pull reviewer of active projects

This commit is contained in:
Alex Cabal 2025-01-30 12:44:57 -06:00
parent d942f4642b
commit 6261eee67f
2 changed files with 3 additions and 3 deletions

View file

@ -780,12 +780,12 @@ final class Project{
/**
* @throws Exceptions\ProjectNotFoundException If the `Project` can't be found.
*/
public static function GetByIdentifierAndIsInProgress(?string $identifier): Project{
public static function GetByIdentifierAndIsActive(?string $identifier): Project{
if($identifier === null){
throw new Exceptions\ProjectNotFoundException();
}
return Db::Query('SELECT Projects.* from Ebooks inner join Projects using (EbookId) where Ebooks.Identifier = ? and Projects.Status = ?', [$identifier, Enums\ProjectStatusType::InProgress], Project::class)[0] ?? throw new Exceptions\ProjectNotFoundException();
return Db::Query('SELECT Projects.* from Ebooks inner join Projects using (EbookId) where Ebooks.Identifier = ? and Projects.Status in (?, ?, ?)', [$identifier, Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::AwaitingReview, Enums\ProjectStatusType::Reviewed], Project::class)[0] ?? throw new Exceptions\ProjectNotFoundException();
}
/**