- serviceDescriptions, ok := ps.publishedServices[apfId]
- if ok {
- err := ctx.JSON(http.StatusOK, serviceDescriptions)
- if err != nil {
- // Something really bad happened, tell Echo that our handler failed
- return err
- }
- } else {
- return sendCoreError(ctx, http.StatusNotFound, fmt.Sprintf("Provider %s not registered", apfId))
+ if !ps.serviceRegister.IsPublishingFunctionRegistered(apfId) {
+ errorMsg := fmt.Sprintf("Unable to get the service due to %s api is only available for publishers", apfId)
+ return sendCoreError(ctx, http.StatusNotFound, errorMsg)