Skip to content

user emojis#519

Open
mcfiredrill wants to merge 4 commits intomainfrom
dj-custom-emojis
Open

user emojis#519
mcfiredrill wants to merge 4 commits intomainfrom
dj-custom-emojis

Conversation

@mcfiredrill
Copy link
Copy Markdown
Member

@mcfiredrill mcfiredrill commented Apr 5, 2026

Adds user emoji support with a model, migration, and API endpoints.

Changes Made

  • Model: UserEmoji with belongs_to :user and has_one_attached :image
  • Migration: Creates user_emojis table with user_id, name, and timestamps
  • API Endpoints:
    • GET /api/user_emojis — lists the current user's emojis
    • POST /api/user_emojis — creates a new user emoji (accepts name and image via JSON:API format)
  • Serializer: UserEmojiSerializer exposing id, name, and image_url
  • User association: Added has_many :user_emojis to the User model

Both API endpoints require authentication.

@mcfiredrill
Copy link
Copy Markdown
Member Author

@copilot create an API endpoint for creating user emojis

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

@copilot create an API endpoint for creating user emojis

Done in commit 2e465c8. Added the following:

  • GET /api/user_emojis — lists the current user's emojis
  • POST /api/user_emojis — creates a new user emoji (accepts name and image via JSON:API format)
  • UserEmojiSerializer returning id, name, and image_url
  • has_many :user_emojis on the User model

Both endpoints require authentication.

@mcfiredrill
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: mcfiredrill <66243+mcfiredrill@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@copilot resolve the merge conflicts in this pull request

Done in commit 23f7bf3. Merged origin/main into the branch and resolved the single conflict in db/schema.rb — kept the newer schema version (2025_09_20_032802) from main and included the user_accessories and user_live_bars tables that were added there.

def index
@user_emojis = current_user.user_emojis
render json: @user_emojis
end
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think we need this index route quite yet @copilot

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removed in commit 8f6599e — deleted the index action from the controller and updated the route to only: [:create].

before_action :authenticate_user!

def create
@user_emoji = current_user.user_emojis.new(user_emoji_params)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot You can only create an emoji if you have enough "emoji slots" left.

You get more after leveling up.

Level 3: 1 additional slots granted
Level 4: 2 additional slots granted
Level 5: 2 additional slots granted

(some kind of gentle curve like this, maxing out at level 30 perhaps)

You must also have the DJ role.

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