Skip to content

Conversation

@myndaaa
Copy link
Owner

@myndaaa myndaaa commented Aug 10, 2025

NOTE: TO BE APPROVED AFTER sub-feat/crud-user

  • implemented endpoints of artist, bands, artist band members
  • modified schema to remove unused redundant schemas
  • added rbac to endpoints
  • added new field to band s, foreign key to user data model to store who is the owner of the band via created_by_user_id to enforce stricter rbac

@myndaaa myndaaa self-assigned this Aug 10, 2025
@myndaaa myndaaa marked this pull request as draft August 10, 2025 16:18
@myndaaa myndaaa changed the base branch from feature/crud-and-route to sub-feat/crud-artists-bands August 21, 2025 12:47
@myndaaa myndaaa marked this pull request as ready for review August 21, 2025 12:47
@myndaaa myndaaa changed the base branch from sub-feat/crud-artists-bands to dev August 22, 2025 09:24
return genre


@router.get("/name/{name}", response_model=GenreOut)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this API. Use a query-param to the GET genre API

Copy link
Owner Author

Choose a reason for hiding this comment

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

Pushed updates and changes

current_admin: dict = Depends(get_current_admin)
):
"""Create a new genre - admin only"""
if genre_name_taken(db, genre_data.name):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we do the same thing by only one database call?

Copy link
Owner Author

Choose a reason for hiding this comment

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

can use integrity error to throw an exception, looked it up working similarly to how it works for CREATE ... IF NOT EXISTS in raw sql

return get_all_songs_paginated(db, skip=skip, limit=limit)


@router.get("/search", response_model=List[SongOut])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this API and add required query-params to the GET API route.

- genre search is case insensitive
- genre name taken check is case insensitive
- no redundant double GET endpoints for genre, only one get endpoint to get all and get via query param.
- Get endpoint allows close matches
- fixed redundant and useless usage of /admin endpoints to : no deletion option for genre, only disable option., admin see all genre others only active ones
- single db call for genre create, removed prechecks and returning exception error based on crud returns
…as {name} in endpoints which might have whitespaces.

- added fuzzy search to song.
- rmeoved /search endpoint in song and resuing current get endpoint with query params
@myndaaa myndaaa mentioned this pull request Aug 25, 2025
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