Skip to content

Commit

Permalink
fixes #707
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj committed Apr 14, 2020
1 parent 4e1c530 commit 4ddad69
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

/*!
* FilePond 4.13.2
* FilePond 4.13.4
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down
2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=a3ab02b70dc2d53a9e5a",
"/js/app.js": "/js/app.js?id=2de9c2811d4a828bf884",
"/css/app.css": "/css/app.css?id=48eae9fc081d95312ccd",
"/css/app-dark.css": "/css/app-dark.css?id=96ccf9a9c90446210f79",
"/favicon.ico": "/favicon.ico?id=f7a1a9d5196af323a9eb"
Expand Down
32 changes: 16 additions & 16 deletions src/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function index(): JsonResponse
break;

default:
return response()->json([], 404);
return response()->json(null, 404);
break;
}
}
Expand All @@ -52,27 +52,27 @@ public function index(): JsonResponse
*/
public function show($id): JsonResponse
{
if (Post::forCurrentUser()->pluck('id')->contains($id)) {
if ($this->isNewPost($id)) {
$uuid = Uuid::uuid4();

return response()->json([
'post' => Post::make([
'id' => $uuid->toString(),
'slug' => "post-{$uuid->toString()}",
]),
'tags' => Tag::forCurrentUser()->get(['name', 'slug']),
'topics' => Topic::forCurrentUser()->get(['name', 'slug']),
]);
} else {
if ($this->isNewPost($id)) {
$uuid = Uuid::uuid4();

return response()->json([
'post' => Post::make([
'id' => $uuid->toString(),
'slug' => "post-{$uuid->toString()}",
]),
'tags' => Tag::forCurrentUser()->get(['name', 'slug']),
'topics' => Topic::forCurrentUser()->get(['name', 'slug']),
]);
} else {
if (Post::forCurrentUser()->pluck('id')->contains($id)) {
return response()->json([
'post' => Post::forCurrentUser()->with('tags:name,slug', 'topic:name,slug')->find($id),
'tags' => Tag::forCurrentUser()->get(['name', 'slug']),
'topics' => Topic::forCurrentUser()->get(['name', 'slug']),
]);
} else {
return response()->json(null, 404);
}
} else {
return response()->json(null, 404);
}
}

Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2533,9 +2533,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

electron-to-chromium@^1.3.390:
version "1.3.403"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.403.tgz#c8bab4e2e72bf78bc28bad1cc355c061f9cc1918"
integrity sha512-JaoxV4RzdBAZOnsF4dAlZ2ijJW72MbqO5lNfOBHUWiBQl3Rwe+mk2RCUMrRI3rSClLJ8HSNQNqcry12H+0ZjFw==
version "1.3.405"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.405.tgz#b84fcb157edb26eae6c36d93d416cb51caa399bd"
integrity sha512-D+xkP+hAQY/790DzImC8bI8QJLaArNG4b74bYvkhkK/fli51JmNyUYxwKLSl/8VPGkkXEqKCupSDD05/E5P72w==

elliptic@^6.0.0:
version "6.5.2"
Expand Down Expand Up @@ -2976,9 +2976,9 @@ filepond-plugin-image-validate-size@^1.2.3:
integrity sha512-T+x3aXPQIJsz7z6zvU43I7XejfM45c8XtCpZEgg3+31viWlqycqENklmUfoTmHk7hmP9mgxtvFhZ+0YVR9xNDQ==

filepond@^4.13.0:
version "4.13.2"
resolved "https://registry.yarnpkg.com/filepond/-/filepond-4.13.2.tgz#bed905adbd3f24d65db54a6150d4f3e0c1ee4953"
integrity sha512-8FGP5cUwYW5udS7p0YcwNskpA3b17K9lmvCzH9U7uUFJwo66pNwtDJjR0gJLqJkLtsM942/Pfq8JygTw2nv7GQ==
version "4.13.4"
resolved "https://registry.yarnpkg.com/filepond/-/filepond-4.13.4.tgz#6b44dbbac8c5b5ce9515a28f776f2e9a19357c01"
integrity sha512-nmS7n89Y7FbP6mIYHVzr3kxuqym15n6o/I/zUKomanWM+3zCg6uIr+mJ5yDUDa7fXoiHBXMKea3Ku2l1zcGCJg==

fill-range@^4.0.0:
version "4.0.0"
Expand Down Expand Up @@ -4262,9 +4262,9 @@ lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==

loglevel@^1.6.6:
version "1.6.7"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.7.tgz#b3e034233188c68b889f5b862415306f565e2c56"
integrity sha512-cY2eLFrQSAfVPhCgH1s7JI73tMbg9YC3v3+ZHVW67sBS7UxWzNEk/ZBbSfLykBWHp33dqqtOv82gjhKEi81T/A==
version "1.6.8"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.8.tgz#8a25fb75d092230ecd4457270d80b54e28011171"
integrity sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==

loose-envify@^1.0.0:
version "1.4.0"
Expand Down Expand Up @@ -4860,9 +4860,9 @@ object-inspect@^1.7.0:
integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==

object-is@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.2.tgz#6b80eb84fe451498f65007982f035a5b445edec4"
integrity sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==
version "1.1.0"
resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.0.tgz#57e5e236f2831066c82948cbd735c24a9e54084d"
integrity sha512-wznR5+ya11MdnkLq+oYePGjW2ge4RY5DVSwa3iKuDCpvLsYGnp24Qy5EzVRgyMHEuEkKd+dX/1JpAT6QxZXq2g==

object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1:
version "1.1.1"
Expand Down

0 comments on commit 4ddad69

Please sign in to comment.