Final fixes to the website which should have been committed in the previous branch :(
Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
@@ -52,8 +52,6 @@ $app->get("/timelineData/{timeline}", function (Request $request, Response $resp
|
||||
$response->getBody()->write(json_encode($timelineData->getWorkData()));
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// something went wrong
|
||||
$response->getBody()->write(json_encode(array("errorMessage" => "Error, timeline data not found")));
|
||||
@@ -73,7 +71,6 @@ $app->patch("/timelineData/{timeline}/{id}", function (Request $request, Respons
|
||||
return $response->withStatus(400);
|
||||
}
|
||||
|
||||
|
||||
if (!$timelineData->updateEduData($data["dateFrom"], $data["dateTo"], $data["grade"], $data["course"], $args["id"]))
|
||||
{
|
||||
// uh oh something went wrong
|
||||
|
||||
@@ -79,7 +79,7 @@ class middleware
|
||||
$app->add(new JwtAuthentication([
|
||||
"rules" => [
|
||||
new RequestPathRule([
|
||||
"path" => ["/api/projectData", "/api/timeline/[a-z]*", "/api/logout"],
|
||||
"path" => ["/api/projectData", "/api/timelineData/[a-z]*", "/api/projectImage/[0-9]*", "/api/logout"],
|
||||
"ignore" => ["/api/contact", "/api/user/login", "/api/user/changePassword"]
|
||||
]),
|
||||
new RequestMethodRule([
|
||||
|
||||
@@ -636,7 +636,7 @@ function updateProjectItem(id, e)
|
||||
if (res.ok)
|
||||
{
|
||||
|
||||
if (data["isMainProject"] === "true")
|
||||
if (updatedProjectImage["isMainProject"] === "true")
|
||||
{
|
||||
document.querySelectorAll(".isMainProject input").forEach(item => item.checked = false);
|
||||
document.querySelector(`#isMainProject${id}`).checked = true;
|
||||
@@ -657,7 +657,7 @@ function updateProjectItem(id, e)
|
||||
}
|
||||
|
||||
document.querySelector(`#projError${id}`).classList.remove("hidden");
|
||||
document.querySelector(`#projError${id} div`).innerHTML = projectDataError.error;
|
||||
document.querySelector(`#projError${id} div`).innerHTML = updatedProjectImage.error;
|
||||
|
||||
}));
|
||||
|
||||
|
||||
+1
-2
@@ -105,8 +105,7 @@ function getProjectData()
|
||||
if (res.ok)
|
||||
{
|
||||
for (let i = 0; i < 4; i++){
|
||||
const item = json[i];
|
||||
if (json[i]["isMainProject"] === "1")
|
||||
if (json[i]["isMainProject"] === 1)
|
||||
{
|
||||
document.getElementById("mainProj").innerHTML = `
|
||||
<h1>${json[i]["title"]}</h1>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ function getProjectData()
|
||||
{
|
||||
json.forEach(item =>
|
||||
{
|
||||
if (item["isMainProject"] === "1")
|
||||
if (item["isMainProject"] === 1)
|
||||
{
|
||||
document.querySelector("#mainProj").innerHTML = `
|
||||
<h1>${item["title"]}</h1>
|
||||
|
||||
Reference in New Issue
Block a user