ApiConfigControllers::post() should detect a conflicting ID and throw a 409 exception

Created on 4 February 2025, about 16 hours ago

Overview

Reported by @balintbrews at #3503547-2: Display validation errors in code component dialogs .

Creating multiple code components in the UI with the same name results in a 500 response.

Proposed resolution

Match what JSON:API does:

    // Return a 409 Conflict response in accordance with the JSON:API spec. See
    // http://jsonapi.org/format/#crud-creating-responses-409.
    if ($this->entityExists($parsed_entity)) {
      throw new ConflictHttpException('Conflict: Entity already exists.');
    }

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Internal HTTP API

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024