File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
app/Http/Controllers/Api/Client Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,14 @@ public function store(StoreApiKeyRequest $request)
6060 */
6161 public function delete (ClientApiRequest $ request , string $ identifier )
6262 {
63+ /** @var \Pterodactyl\Models\ApiKey $key */
6364 $ key = $ request ->user ()->apiKeys ()
6465 ->where ('key_type ' , ApiKey::TYPE_ACCOUNT )
6566 ->where ('identifier ' , $ identifier )
66- ->first ();
67+ ->firstOrFail ();
6768
6869 Activity::event ('user:api-key.delete ' )
69- ->property ('identifer ' , $ key ->identifer )
70+ ->property ('identifer ' , $ key ->identifier )
7071 ->log ();
7172
7273 $ key ->delete ();
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ public function testSSHKeyCanBeDeleted()
4646 $ this ->assertSoftDeleted ($ key );
4747 $ this ->assertNotSoftDeleted ($ key2 );
4848
49- $ this ->deleteJson ($ this ->link ($ key ))->assertNoContent ();
50- $ this ->deleteJson ($ this ->link ($ key2 ))->assertNoContent ();
49+ $ this ->deleteJson ($ this ->link ($ key ))->assertNotFound ();
50+ $ this ->deleteJson ($ this ->link ($ key2 ))->assertNotFound ();
5151
5252 $ this ->assertNotSoftDeleted ($ key2 );
5353 }
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ abstract class IntegrationTestCase extends TestCase
1313
1414 protected array $ connectionsToTransact = ['mysql ' ];
1515
16+ protected $ defaultHeaders = [
17+ 'Accept ' => 'application/json ' ,
18+ ];
19+
1620 /**
1721 * Return an ISO-8601 formatted timestamp to use in the API response.
1822 */
You can’t perform that action at this time.
0 commit comments