Skip to content

Commit

Permalink
fix: Legacy extension functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Dec 12, 2023
1 parent c86658f commit b11ab28
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions app/Http/Controllers/API/Settings/ExtensionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ private function setupNewExtension($zipFile, $verify = false)
if (! $zip->open($zipFile)) {
system_log(7, 'EXTENSION_UPLOAD_FAILED_CORRUPTED');

return [response()->json('Eklenti dosyası açılamıyor.', 500), null];
return [response()->json([
'message' => 'Eklenti dosyası açılamıyor.'
], 500), null];
}

// Determine a random tmp folder to extract files
Expand All @@ -295,7 +297,9 @@ private function setupNewExtension($zipFile, $verify = false)
try {
$zip->extractTo($path);
} catch (\Exception) {
return [response()->json('Eklenti dosyası açılamıyor.', 500), null];
return [response()->json([
'message' => 'Eklenti dosyası açılamıyor.'
], 500), null];
}

if (count(scandir($path)) == 3) {
Expand All @@ -309,7 +313,9 @@ private function setupNewExtension($zipFile, $verify = false)

preg_match('/[A-Za-z-]+/', (string) $json['name'], $output);
if (empty($output) || $output[0] != $json['name']) {
return [response()->json('Eklenti isminde yalnızca harflere izin verilmektedir.', 422), null];
return [response()->json([
'message' => 'Eklenti adı geçerli değil.'
], Response::HTTP_UNPROCESSABLE_ENTITY), null];
}

if (
Expand Down Expand Up @@ -339,7 +345,9 @@ private function setupNewExtension($zipFile, $verify = false)
if ($extension->version == $json['version']) {
system_log(7, 'EXTENSION_UPLOAD_FAILED_ALREADY_INSTALLED');

return [response()->json('Eklentinin bu sürümü zaten yüklü.', 422), null];
return [response()->json([
'message' => 'Bu eklenti zaten yüklü.'
], Response::HTTP_UNPROCESSABLE_ENTITY), null];
}
}

Expand Down
2 changes: 1 addition & 1 deletion public/js/liman.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/css/liman.css": "/css/liman.css?id=d22dd5a3c18434af4ea54f484ea5a343",
"/js/liman.js": "/js/liman.js?id=9cc716cdbb88880b49c37ea745378859"
"/js/liman.js": "/js/liman.js?id=d6ad7e57f9b4a654e0667a2b6e3959b4"
}
2 changes: 1 addition & 1 deletion resources/assets/js/liman.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function message(data) {
}
const modal_id = modal.getAttribute("id");
const selector = window.$("#" + modal_id + "_alert");
const color = "alert-info";
let color = "alert-info";
switch (json["status"]) {
case 200:
color = "alert-success";
Expand Down

0 comments on commit b11ab28

Please sign in to comment.