Skip to content

Commit

Permalink
Merge pull request #134 from fleetbase/dev-v1.5.28
Browse files Browse the repository at this point in the history
v1.5.28 ~ minor patches
  • Loading branch information
roncodes authored Feb 12, 2025
2 parents 3b0dbaa + 85661d8 commit a027b6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/core-api",
"version": "1.5.27",
"version": "1.5.28",
"description": "Core Framework and Resources for Fleetbase API",
"keywords": [
"fleetbase",
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Category extends Model
*
* @var array
*/
protected $searchableColumns = ['name'];
protected $searchableColumns = ['name', 'tags', 'description'];

/**
* The attributes that are mass assignable.
Expand Down
7 changes: 3 additions & 4 deletions src/Traits/HasApiModelBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public function queryFromRequest(Request $request, ?\Closure $queryCallback = nu

if (intval($limit) > 0) {
$builder->limit($limit);
} elseif ($limit === -1) {
$limit = 999999999;
$builder->limit($limit);
}

// if queryCallback is supplied
Expand All @@ -125,10 +128,6 @@ public function queryFromRequest(Request $request, ?\Closure $queryCallback = nu
// Utils::sqlDump($builder);

if (Http::isInternalRequest($request)) {
if ($limit === -1) {
$limit = 999999999;
}

return $builder->fastPaginate($limit, $columns);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Traits/PurgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function backupAndDelete(string $modelClass, string $tableName, $cutof
$this->info("Backing up {$records->count()} records from {$tableName}...");

// Create SQL dump
$sqlDumpFileName = str_replace([' '], '_', "{$tableName}_backup_{$firstRecordDate}_to_{$lastRecordDate}_created_{$currentDate}.sql");
$sqlDumpFileName = str_replace([' ', ':'], '_', "{$tableName}_backup_{$firstRecordDate}_to_{$lastRecordDate}_created_{$currentDate}.sql");
$localPath = storage_path("app/tmp/{$sqlDumpFileName}");
$remotePath = "{$path}/{$sqlDumpFileName}";
$backupData = $records->map(function ($record) {
Expand Down

0 comments on commit a027b6a

Please sign in to comment.