mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-29 22:56:37 -04:00
comment_domain_path_get.go: include path in return
This commit is contained in:
25
api/comment_domain_path_get.go
Normal file
25
api/comment_domain_path_get.go
Normal file
@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import ()
|
||||
|
||||
func commentDomainPathGet(commentHex string) (string, string, error) {
|
||||
if commentHex == "" {
|
||||
return "", "", errorMissingField
|
||||
}
|
||||
|
||||
statement := `
|
||||
SELECT domain, path
|
||||
FROM comments
|
||||
WHERE commentHex = $1;
|
||||
`
|
||||
row := db.QueryRow(statement, commentHex)
|
||||
|
||||
var domain string
|
||||
var path string
|
||||
var err error
|
||||
if err = row.Scan(&domain, &path); err != nil {
|
||||
return "", "", errorNoSuchDomain
|
||||
}
|
||||
|
||||
return domain, path, nil
|
||||
}
|
Reference in New Issue
Block a user