com-pas / compas-scl-data-service

Service to store and retrieve the SCL XML to a database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Rest API to check if a SCL Name isn't already used

dlabordus opened this issue · comments

As a engineer
I want to have faster feedback when changing/using a SCL Name
So that I can change the name before the add/save returned a error

Background:
Issues #197 and #203 implement check the SCL Name isn't already used during adding/saving of the SCL File.
It would be nice that the front-end can make a call to check this before executing the add/save action.

  • Add a new Rest API Call (Post) to check if a name isn't already used ("/scl/v1/{type}/checkname")
  • It will retrieve the filename are parameter in the Request Body
  • Use this name to make the call the service layer, which make the call to the repository.
  • In the response return true/false to indicate if the name is unique.

After this issue; com-pas/compas-open-scd#147 can be build.

@dlabordus is this issue still valid as it is formulated?

Yes, however it is a low priority issue in my opinion.

@Sander3003, onder welke rechten moet dit vallen?
Als het onder {TYPE}_create valt, kan het zijn dat een update evt fout gaat.
als het onder {TYPE}_update valt, kan het zijn dat een create evt fout gaat.

Lijkt mij persoonlijk het handigst om het onder {TYPE}_read of iets te zetten

{TYPE}_read is fine for me, if the user has insufficient rights, it cannot save the changes to the database.