Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Oct 28, 2024
1 parent 34d22b5 commit 2a043d9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/mindwendel/services/s3_object_storage_local_sandbox_service.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
defmodule Mindwendel.Services.S3ObjectStorageLocalSandboxService do
def get_object(_bucket_name, bucket_path) do
dest = Path.join("priv/static/uploads", Path.basename(bucket_path))
{:ok, content} = File.read(dest)
{:ok, %{status_code: 200, body: content}}
end

def put_object(_bucket_name, bucket_path, file, _opts) do
dest = Path.join("priv/static/uploads", Path.basename(bucket_path))
File.write(dest, file)
{:ok, {}}
end

def delete_object(_bucket_name, file_to_delete) do
dest = Path.join("priv/static/uploads", Path.basename(file_to_delete))
File.rm(dest)
{:ok, {}}
end
end

0 comments on commit 2a043d9

Please sign in to comment.