Skip to content

Move the object type mapping and such to the base controller to de-dupe#17551

Merged
snipe merged 3 commits intodevelopfrom
move-file-uploads-paths-to-base-controller
Aug 11, 2025
Merged

Move the object type mapping and such to the base controller to de-dupe#17551
snipe merged 3 commits intodevelopfrom
move-file-uploads-paths-to-base-controller

Conversation

@snipe
Copy link
Copy Markdown
Member

@snipe snipe commented Aug 10, 2025

I'm not sure if you'll like this one, @uberbrady, or if there's a better place to put this, but this just de-dupes the mappings in the base controllers instead of the individual controllers.

@snipe snipe requested a review from uberbrady August 10, 2025 15:31
@uberbrady
Copy link
Copy Markdown
Member

Honestly I don't hate it that much. I would've probably gone with putting it in maybe a Helper or something, but that's not something I care very much about; it's fine like this. I also hate duplicated data structures like how it was before (it's an easy way to make mistakes), so this makes sense to me.

Copy link
Copy Markdown
Member

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

Less duplication = more better. If we maybe find a better place to put it some other day, also fine with that. But I think it's probably just fine where it is for now.

@snipe
Copy link
Copy Markdown
Member Author

snipe commented Aug 11, 2025

Thing is, I tried to find a better place. Other than traits, this at least seems kinda straightforward and less duplicative. If you have better ideas, I'm all ears, seriously. Just hated the repetition in the ctonrollers. Ideally, I want these on the model level, but... I also want a pony, so...

@snipe snipe merged commit 7974bad into develop Aug 11, 2025
7 of 8 checks passed
@snipe snipe deleted the move-file-uploads-paths-to-base-controller branch August 11, 2025 04:44
Yvejen pushed a commit to Yvejen/snipe-it that referenced this pull request Nov 19, 2025
…ds-paths-to-base-controller

Move the object type mapping and such to the base controller to de-dupe
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.

2 participants