changed how a few code snippets work and added in all projects section to view all the current projects includig <div class="grid__item"></div>
<div class="grid__item"></div>
<div class="grid__item"></div>
<div class="grid__item"></div>the one as the main
Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
+15
-2
@@ -81,6 +81,7 @@ $app->patch("/timelineData/{timeline}/{id}", function (Request $request, Respons
|
||||
return $response->withStatus(500);
|
||||
}
|
||||
|
||||
$response->withStatus(201);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -100,6 +101,7 @@ $app->patch("/timelineData/{timeline}/{id}", function (Request $request, Respons
|
||||
return $response->withStatus(500);
|
||||
}
|
||||
|
||||
$response->withStatus(201);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -160,6 +162,7 @@ $app->post("/timelineData/{timeline}", function (Request $request, Response $res
|
||||
}
|
||||
|
||||
$response->getBody()->write(json_encode(array("ID" => $insertedID)));
|
||||
$response->withStatus(201);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -186,6 +189,7 @@ $app->post("/timelineData/{timeline}", function (Request $request, Response $res
|
||||
}
|
||||
|
||||
$response->getBody()->write(json_encode(array("ID" => $insertedID)));
|
||||
$response->withStatus(201);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -225,10 +229,19 @@ $app->patch("/projectData/{id}", function (Request $request, Response $response,
|
||||
return $response->withStatus(400);
|
||||
}
|
||||
|
||||
if (!$projectData->updateProjectData($args["id"], $data["title"], $data["isMainProject"], $data["information"], $data["projectLink"], $data["gitLink"]))
|
||||
$update = $projectData->updateProjectData($args["id"], $data["title"], $data["isMainProject"], $data["information"], $data["projectLink"], $data["gitLink"]);
|
||||
|
||||
if ($update === "unset main project")
|
||||
{
|
||||
// uh oh something went wrong
|
||||
$response->getBody()->write(json_encode(array("error" => "Something went wrong", "data" => $projectData->updateProjectData($args["id"], $data["title"], $data["isMainProject"], $data["information"], $data["projectLink"], $data["gitLink"]))));
|
||||
$response->getBody()->write(json_encode(array("error" => "Can't unset project as main project, try updating another project as the main project")));
|
||||
return $response->withStatus(400);
|
||||
}
|
||||
|
||||
if (!$update)
|
||||
{
|
||||
// uh oh something went wrong
|
||||
$response->getBody()->write(json_encode(array("error" => "Something went wrong")));
|
||||
return $response->withStatus(500);
|
||||
}
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user