Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/api/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func GetAudit(c *gin.Context) {
if err != nil {
er := models.LicenseError{
Status: http.StatusBadRequest,
Message: fmt.Sprintf("no license with id '%s' exists", id),
Message: fmt.Sprintf("no audit with id '%s' exists", id),
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down Expand Up @@ -154,7 +154,7 @@ func GetChangeLogs(c *gin.Context) {
if err != nil {
er := models.LicenseError{
Status: http.StatusBadRequest,
Message: fmt.Sprintf("no license with id '%s' exists", id),
Message: fmt.Sprintf("no audit with id '%s' exists", id),
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down Expand Up @@ -221,7 +221,7 @@ func GetChangeLogbyId(c *gin.Context) {
if err != nil {
er := models.LicenseError{
Status: http.StatusBadRequest,
Message: fmt.Sprintf("no license with id '%s' exists", auditId),
Message: fmt.Sprintf("no audit with id '%s' exists", auditId),
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand All @@ -234,7 +234,7 @@ func GetChangeLogbyId(c *gin.Context) {
if err != nil {
er := models.LicenseError{
Status: http.StatusBadRequest,
Message: fmt.Sprintf("no license with id '%s' exists", changelogId),
Message: fmt.Sprintf("no changelog with id '%s' exists", changelogId),
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func GetDashboardData(c *gin.Context) {
er := models.LicenseError{
Status: http.StatusInternalServerError,
Message: "something went wrong",
Error: "error fetching risk liicense frequencies",
Error: "error fetching risk license frequencies",
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/api/obligations.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func UpdateObligation(c *gin.Context) {
}); err != nil {
er := models.LicenseError{
Status: http.StatusBadRequest,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down Expand Up @@ -636,7 +636,7 @@ func ImportObligations(c *gin.Context) {
if err := addChangelogsForObligation(tx, userId, &oldObligation, &models.Obligation{}); err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down Expand Up @@ -684,7 +684,7 @@ func ImportObligations(c *gin.Context) {
if err := tx.Joins("Classification").Joins("Type").Preload("Licenses").First(&oldObligation, oldObligation.Id).Error; err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand All @@ -695,7 +695,7 @@ func ImportObligations(c *gin.Context) {
if err := addChangelogsForObligation(tx, userId, &oldObligation, &models.Obligation{}); err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down Expand Up @@ -734,7 +734,7 @@ func ImportObligations(c *gin.Context) {
if err := tx.Model(&models.Obligation{}).Where(models.Obligation{Id: oldObligation.Id}).UpdateColumn("external_ref", gorm.Expr("jsonb_strip_nulls(COALESCE(external_ref, '{}'::jsonb) || ?)", ob.ExternalRef)).Error; err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand All @@ -745,7 +745,7 @@ func ImportObligations(c *gin.Context) {
if err := tx.Omit("ExternalRef", "Licenses", "Topic").Updates(&newObligation).Error; err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand All @@ -771,7 +771,7 @@ func ImportObligations(c *gin.Context) {
if err := tx.Joins("Type").Joins("Classification").Preload("Licenses").First(&newObligation).Error; err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand All @@ -782,7 +782,7 @@ func ImportObligations(c *gin.Context) {
if err := addChangelogsForObligation(tx, userId, &newObligation, &oldObligation); err != nil {
res.Data = append(res.Data, models.LicenseError{
Status: http.StatusInternalServerError,
Message: "Failed to update license",
Message: "Failed to update obligation",
Error: err.Error(),
Path: c.Request.URL.Path,
Timestamp: time.Now().Format(time.RFC3339),
Expand Down