Used CKEditor for being able to edit the post body. Added the ability to make a post and send it to the backend. Formatted post on backend by moving images into respective directory with the post name and unique ID. Showed message if errored or succeeded.
Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
Vendored
+3
-3
@@ -113,7 +113,7 @@ class projectRoutes implements routesInterface
|
||||
{
|
||||
// uh oh sent some empty data
|
||||
$response->getBody()->write(json_encode(array("error" => "Only some of the data was sent")));
|
||||
return $response->withStatus(400);
|
||||
return $response->withStatus(400)->withStatus(201);
|
||||
}
|
||||
|
||||
$insertedID = $this->projectData->addProjectData($data["title"], $data["isMainProject"], $data["information"], $data["projectLink"], $data["gitLink"]);
|
||||
@@ -125,7 +125,7 @@ class projectRoutes implements routesInterface
|
||||
}
|
||||
|
||||
$response->getBody()->write(json_encode(array("ID" => $insertedID)));
|
||||
return $response;
|
||||
return $response->withStatus(201);
|
||||
});
|
||||
|
||||
$app->post("/projectImage/{id}", function (Request $request, Response $response, array $args)
|
||||
@@ -147,7 +147,7 @@ class projectRoutes implements routesInterface
|
||||
}
|
||||
|
||||
$response->getBody()->write(json_encode($message));
|
||||
return $response;
|
||||
return $response->withStatus(201);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user