Debug via log
This commit is contained in:
parent
07ad894b66
commit
a632a8e2da
2 changed files with 5 additions and 2 deletions
|
@ -54,6 +54,7 @@ class MicropubClientController extends Controller
|
|||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
Log::info('posting new note');
|
||||
$domain = $request->session()->get('me');
|
||||
$token = $request->session()->get('token');
|
||||
|
||||
|
@ -62,12 +63,14 @@ class MicropubClientController extends Controller
|
|||
$this->indieClient
|
||||
);
|
||||
if (! $micropubEndpoint) {
|
||||
Log::error('no known endpoint to post to');
|
||||
return redirect(route('micropub-client'))->withErrors('Unable to determine micropub API endpoint', 'endpoint');
|
||||
}
|
||||
|
||||
$response = $this->postNoteRequest($request, $micropubEndpoint, $token);
|
||||
|
||||
if ($response->getStatusCode() == 201) {
|
||||
Log::info('redirecting to note');
|
||||
$location = $response->getHeader('Location');
|
||||
if (is_array($location)) {
|
||||
return redirect($location[0]);
|
||||
|
@ -75,7 +78,7 @@ class MicropubClientController extends Controller
|
|||
|
||||
return redirect($location);
|
||||
}
|
||||
|
||||
Log::error('note not created');
|
||||
return redirect(route('micropub-client'))->withErrors('Endpoint didn’t create the note.', 'endpoint');
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class MicropubClientTest extends DuskTestCase
|
|||
$faker = \Faker\Factory::create();
|
||||
$note = $faker->text;
|
||||
$this->browse(function ($browser) use ($note) {
|
||||
$browser->visit('/micropub/create')
|
||||
$browser->visit(route('micropub-client'))
|
||||
->type('textarea[name="content"]', $note)
|
||||
->press('submit');
|
||||
sleep(2);
|
||||
|
|
Loading…
Add table
Reference in a new issue