Skip to content

Commit

Permalink
fix: allow altering an asset's folder in dynamic folder mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvantuycom committed Apr 8, 2024
1 parent 9267de0 commit 3edc326
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CloudinaryAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ public function move(string $source, string $destination, Config $config): void
$options["asset_folder"] = $folder;
}
}
$this->client->uploadApi()->rename($publicId, $newPublicId, $options);
if ($newPublicId === $publicId) {
$this->client->adminApi()->update($publicId, $options);
} else {
$this->client->uploadApi()->rename($publicId, $newPublicId, $options);
}
} catch (Throwable $e) {
throw UnableToMoveFile::fromLocationTo($source, $destination, $e);
}
Expand Down

0 comments on commit 3edc326

Please sign in to comment.