Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: Reworked image upload, using IFormFile instead of byte arrays #68

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

Metawolve
Copy link
Member

@Metawolve Metawolve commented Jun 14, 2024

I replaced the old API endpoint which took a byte array as string and replaced it by two API endpoints. A Post endpoint which takes a IFormFile as input and therefore allows file uploads, and a Put endpoint which allows replacing a file with the same id.

BREAKING CHANGE: I also changed the fursuit badge registration: Instead of passing a byte array with the image data, an image id is passed. So adding a fursuit badge registration is now a two-step process with first uploading the image using the image endpoint and then passing the image id.

Before:

{
  "BadgeNo": 6,
  "RegNo": 6,
  "Name": "Meta",
  "WornBy": "Meta",
  "Species": "Protogen",
  "Gender": "male",
  "ImageContent ": "longByteArrayWithImageData",
  "DontPublish": 0,
  "CollectionCode": "123"
}

After:

{
  "BadgeNo": 6,
  "RegNo": 6,
  "Name": "Meta",
  "WornBy": "Meta",
  "Species": "Protogen",
  "Gender": "male",
  "ImageId": "10e3fbf7-7703-4b82-b960-931b54c000f2",
  "DontPublish": 0,
  "CollectionCode": "123"
}

@Metawolve Metawolve linked an issue Jun 14, 2024 that may be closed by this pull request
@Metawolve Metawolve requested review from Rain336 and Fenrikur June 14, 2024 17:31
@Metawolve Metawolve self-assigned this Jun 14, 2024
@Metawolve Metawolve added the feature Request for an entirely new feature label Jun 14, 2024
@Metawolve Metawolve added this to the EF28 (2024) milestone Jun 14, 2024
@Metawolve Metawolve merged commit 79d9579 into main Jun 29, 2024
@Metawolve Metawolve deleted the 41-add-image-upload-endpoint branch June 29, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request for an entirely new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add image upload endpoint
2 participants