Include edit Project Status

This commit is contained in:
Bruno F. Fontes 2021-02-12 19:03:12 -03:00
parent b739763448
commit f14492d744
Signed by: brunofontes
GPG Key ID: EE3447CE80048495

View File

@ -42,4 +42,19 @@ class Project extends \BrunoFontes\Memsource\BaseApi
throw new \Exception("Error getting project {$projectUid}: " . $this->getError($response), 1); throw new \Exception("Error getting project {$projectUid}: " . $this->getError($response), 1);
} }
} }
/**
* Edit the project status
*
* @param string $projectUid The project UID
* @param string $status The new status
*/
public function editStatus(string $projectUid, string $status): void
{
$queryParam = ['status' => $status];
$response = $this->fetchApi->fetch('jsonPost', "{$this->_url}/{$projectUid}/setStatus", $queryParam);
if ($this->hasError($response)) {
throw new \Exception("Error editing project status on project: {$projectUid}: " . $this->getError($response), 1);
}
}
} }