Details
-
Bug
-
Status: In Progress
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
I was looking for a bug while looking at the API to create the `deleteService` function in `graphql`.
The code below is a management API that delete the service.
def delete(id: Int)(implicit session: DBSession = AutoSession) = { val service = findById(id) val serviceName = service.serviceName sql"""delete from service_columns where id = ${id}""".execute.apply() val cacheKeys = List (s "id = $ id", s "serviceName = $ serviceName") cacheKeys.foreach {key => expireCache (key) expireCaches (key) } }
After deleting all of the serviceColumns associated with it, but there is no part to erase the service.
Improvement direction.
- Check whether the label associated with the service exists
- Add a friendly error message (change return type from Boolean to Try)