(targetKey string)
| 229 | } |
| 230 | |
| 231 | func resolveStoreCommentTarget(targetKey string) (*commentTarget, error) { |
| 232 | owner, name, err := util.GetOwnerAndNameFromIdWithError(targetKey) |
| 233 | if err != nil { |
| 234 | return nil, err |
| 235 | } |
| 236 | |
| 237 | store, err := object.GetStore(util.GetIdFromOwnerAndName(owner, name)) |
| 238 | if err != nil { |
| 239 | return nil, err |
| 240 | } |
| 241 | if store == nil || store.PublishState != "Published" { |
| 242 | return nil, fmt.Errorf("Comment target does not exist") |
| 243 | } |
| 244 | |
| 245 | return &commentTarget{Owner: store.Owner}, nil |
| 246 | } |
| 247 | |
| 248 | // resolveIssueCommentTarget validates that the issue exists and resolves the |
| 249 | // owner allowed to moderate its comments (the issue's store owner). |
no test coverage detected