This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit ddd9ad64dd250b4802c7c70ab80687fa4f7e5e48 Author: Benjamin <poussin@codelutin.com> Date: Thu May 28 23:23:29 2020 +0200 correction recup pour l'edition --- pkg/http/bookmarkResource.go | 3 +++ pkg/repository/bookmarkRepository.go | 2 +- web/src/views/BookmarkEdit.vue | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/http/bookmarkResource.go b/pkg/http/bookmarkResource.go index 5809fd0..9738e9b 100644 --- a/pkg/http/bookmarkResource.go +++ b/pkg/http/bookmarkResource.go @@ -59,6 +59,9 @@ func getBookmark(w http.ResponseWriter, r *http.Request) { return } + // on a au moins un resultat (sinon 404) on supprime les [] + json = json[1 : len(json)-1] + w.Header().Add("Content-Type", "application/json") io.WriteString(w, json) } diff --git a/pkg/repository/bookmarkRepository.go b/pkg/repository/bookmarkRepository.go index e2e04ae..1e01756 100644 --- a/pkg/repository/bookmarkRepository.go +++ b/pkg/repository/bookmarkRepository.go @@ -107,7 +107,7 @@ func BookmarkJSON(currentUser model.BowUser, id string, uri string, tags []strin BookmarkByIDJSON retourne le bookmark au format json */ func BookmarkByIDJSON(currentUser model.BowUser, id string) (string, error) { - q := &query{sql: `select json_agg(b.*) as result from bookmark b where id=$4)`} + q := &query{sql: `select json_agg(b.*) as result from bookmark b where id=$1`} result, err := q.QueryString(currentUser, id) if err != nil { diff --git a/web/src/views/BookmarkEdit.vue b/web/src/views/BookmarkEdit.vue index f128373..fcbfc57 100644 --- a/web/src/views/BookmarkEdit.vue +++ b/web/src/views/BookmarkEdit.vue @@ -6,7 +6,7 @@ <input type="text" v-model.trim="bookmark.uri" placeholder="add uri" /> <br /> <!-- <span>{{ bookmark.authenticationinfo }}</span> faire afficher une popup de modification de l'objet auth--> <textarea v-model.trim="bookmark.description" placeholder="add description"></textarea> - <TagsInput id="tags" v-model="bookmark.tags"></TagsInput> <!-- <input type="text" v-model.trim="bookmark.tags" /> <br /> --> + <TagsInput id="tags" v-model="bookmark.tags"></TagsInput> <!-- <span>{{ bookmark.lang }}</span> --> <!-- <span>{{ bookmark.owner }}</span> si mon id n'est pas le meme alors c'est le bookmark d'un autre partage par un group --> <label for="private-alias">private alias: -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.