Closed armintalaie closed 2 months ago
DELETE endpoint case 2: unsuccessful - file does not exist deleteObject(params = {}, callback) ⇒ AWS.Request Removes an object from a bucket. The behavior depends on the bucket's versioning state:
If versioning is enabled, the operation removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects but will still respond that the command was successful.
If versioning is suspended or not enabled, the operation permanently deletes the object.
Basically, S3 responds with a success if the object does not exist. if we want, i can do a check if the objectKey exists and throw an error if it doesnt.
PATCH endpoint "If you upload an object with a key name that already exists in a versioning-enabled bucket, Amazon S3 creates another version of the object instead of replacing the existing object."
it seems there is no "PATCH" or "UPDATE" in s3; "No, there is no concept of updating a file on S3. A file on S3 is updated the same way it is uploaded in the first place - through a PUT object request." we will have to read the object, make changes to the object, and then write the entire object back to s3.
implementing the doc manipulations for S3 via an API
currently only have a
GET
[ ] good to look into the API conventions - especially for future-proofing
{baseURL}/area/{areaid}/docs/{docid}
{baseURL}/area/{areaid}/docs?q=meeting%20notes
[ ] good to look into HTTP Responses especially for cleaner access
Acceptance Criteria
DELETE
) to delete a doc via its pathPATCH
) to update a doc via its pathGET
endpoint to retrieve a doc via its pathwould not need to be safeguarded by user auth at this point