mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 09:32:24 -04:00
Correctly pull reviewer of active projects
This commit is contained in:
parent
d942f4642b
commit
6261eee67f
2 changed files with 3 additions and 3 deletions
|
@ -780,12 +780,12 @@ final class Project{
|
||||||
/**
|
/**
|
||||||
* @throws Exceptions\ProjectNotFoundException If the `Project` can't be found.
|
* @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){
|
if($identifier === null){
|
||||||
throw new Exceptions\ProjectNotFoundException();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,7 +5,7 @@ try{
|
||||||
if($urlPath !== null){
|
if($urlPath !== null){
|
||||||
$identifier = EBOOKS_IDENTIFIER_PREFIX . trim(str_replace('.', '', $urlPath), '/'); // Contains the portion of the URL (without query string) that comes after `https://standardebooks.org/ebooks/`.
|
$identifier = EBOOKS_IDENTIFIER_PREFIX . trim(str_replace('.', '', $urlPath), '/'); // Contains the portion of the URL (without query string) that comes after `https://standardebooks.org/ebooks/`.
|
||||||
|
|
||||||
$project = Project::GetByIdentifierAndIsInProgress($identifier);
|
$project = Project::GetByIdentifierAndIsActive($identifier);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$project = Project::Get(HttpInput::Int(GET, 'project-id'));
|
$project = Project::Get(HttpInput::Int(GET, 'project-id'));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue