Skip to content

Commit

Permalink
test owner of url
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Jun 28, 2022
1 parent 55bdb76 commit badd7eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions url/handler/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ func (e *Url) Delete(ctx context.Context, req *url.DeleteRequest, rsp *url.Delet

id := strings.TrimPrefix(req.ShortURL, e.hostPrefix)

// check if exists
recs, err := store.Read("urlOwner/" + tenantId + "/" + id)
if err != nil || len(recs) == 0 {
// swallow error
return nil
}

// delete the url
store.Delete("url/" + id)

Expand Down

0 comments on commit badd7eb

Please sign in to comment.