Skip to content

Conversation

@pachonjcl
Copy link
Collaborator

@pachonjcl pachonjcl requested a review from roguenet January 6, 2026 21:34
import { ApiProperty } from "@nestjs/swagger";
import { JsonApiDto } from "@terramatch-microservices/common/decorators";

@JsonApiDto({ type: "mediaBulkResponse" })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resource types should be plural: mediaBulkResponses

return this.entitiesService.mediaDto(media, { entityType: media.modelType as EntityType, entityUuid: model.uuid });
}

@Post("/site/:siteUuid/bulkUpload")
Copy link
Collaborator

@roguenet roguenet Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be sites. In the end though, I don't love how specific this is to just sites photo collections. It would be a lot better to have the current uploadFile method be able to accept a bulk body in addition to the single upload body. A bulkUpload is not a resource - it's an action, so this endpoint is constructed like an RPC method, not a REST endpoint. There are a few other places (like in the form data provider) where we handle bulk uploads by issuing multiple requests at the same time.

I would say this bulk upload should either be made generic so that it can be done for any entity / collection, or this photo upload bulk process should use that same client side pattern being used in the link above.

If you decide to make this endpoint generic for all entities and want help getting the body parameter to work correctly with two different possible types, let me know. I imagine that will be a little tricky to wire up.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... I just remembered this is for Flority. Does this ticket need to be in the current release? I want to make the current endpoint more adaptable (perhaps it only accepts "bulk" uploads, but sometimes the client only sends a single file, which might be simpler), but I think that's going to be enough additional work that it will delay the release if we try to include it.

I'm going to hold off on reviewing the rest of this PR for now.

Base automatically changed from release/unique-ulexite to main January 8, 2026 20:50
@pachonjcl pachonjcl closed this Jan 20, 2026
@pachonjcl pachonjcl deleted the feat/TM-2769_flority_migration_bulk_upload branch January 20, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants