Skip to content

Commit

Permalink
Stop texting myself.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 10, 2024
1 parent 139f201 commit 8cbcea1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/api_preference.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ static function pref_api(Contact $user, Qrequest $qreq, ?PaperInfo $prow) {
$postpref = null;
if ($qreq->method() === "POST") {
if (!isset($qreq->pref)) {
return JsonResult::make_missing_error("pref");
return JsonResult::make_missing_error("pref")->set_status(200);
}
$postpref = Preference_AssignmentParser::parse_check($qreq->pref, $user->conf);
if (is_string($postpref)) {
return JsonResult::make_parameter_error("pref", $postpref);
return JsonResult::make_parameter_error("pref", $postpref)->set_status(200);
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ static function make_not_found_error($field = null, $ftext = null) {
}


/** @param int $status
* @return $this */
function set_status($status) {
$this->status = $status;
return $this;
}

/** @param bool $pp
* @return $this */
function set_pretty_print($pp) {
Expand Down

0 comments on commit 8cbcea1

Please sign in to comment.