HTTP request to ‘http://localhost:7007/api/v0/commits’ failed with status ‘Internal Server Error’: {“error”:“Can not verify signature for commit bagcqcera…: invalid_jws: not a valid verificationMethod for issuer: did:key:z6Mkn6apNNb8yWrxnuUT…”}
How should make liking others posts (I guess mutating some of the fields of it, to be more accurate) available? Thanks
In re-reviewing your question I think I understand what’s happening here. Your goal is to have other users who were not the original author of each corresponding Post be able to like those posts. However, your Post model currently has a Likes array. Since each document can only have one controller, you won’t be able to have other users mutate this field (which is why I suspect you’re receiving those error messages). Instead, I’d recommend creating a separate model that defines the relationship between likes and corresponding posts.
This blog article actually does a great job of walking through how to define those relations and query against them.
thanks… so I changed the models and separated them
now I want to be able to like the post, so here’s the model
type Post @loadModel(id: "kjzl6hvfrbw6c7oyieu386yamok6facluch99pkbenqe4cc8qw27a271uf1ghnf") {
id: ID!
}
type Author {
id: StreamID!
userName: String! @string(minLength: 1, maxLength: 100)
}
type Like @createModel(accountRelation: SINGLE, description: "A post like") {
author: Author
postID: StreamID! @documentReference(model: "Post")
post: Post! @relationDocument(property: "postID")
}
I just thought about it wrong I guess, needing to have a logic of that a user can like a post only once, but the accountReference SINGLE I guess means that a user would only be able to like only one post
yeah, what you’re looking for is what we have described internally as the SET accountRelation - where the user can have multiple but only one per a given relation to another document. That is a feature request we are looking to build in the coming months.
CC @jpham - feature request for SET account relation