Beispiel #1
0
//                 "message" => "Please specify uploadId.",
//                 "error"   => 1,
//             ]);
//     }
//     if (!isset($postParams["jobseekerId"])) {
//         return $response
//             ->withStatus(422)
//             ->withJson([
//                 "success" => false,
//                 "message" => "Please specify jobseekerId.",
//                 "error"   => 2,
//             ]);
//     }
//     $uploadId     = $postParams["uploadId"];
//     $jobseekerId  = $postParams["jobseekerId"];
//     $updateResult = CV::linkJobseekerToUpload($jobseekerId, $uploadId);
//     return $response->withStatus(200)
//         ->withJson($updateResult);
// });
$app->delete('/cv/{id}', function ($request, $response, $args) {
    $id = $args['id'];
    if (!isset($id)) {
        return $response->withStatus(422)->withJson(["success" => false, "message" => "Please specify id."]);
    }
    $result = CV::delete($id);
    if ($result->success) {
        return $response->withStatus(200)->withJson($result);
    } else {
        return $response->withStatus(422)->withJson($result);
    }
});