23 lines
709 B
JavaScript
23 lines
709 B
JavaScript
import config from "../../../config/index.js";
|
|
export default async function renderVote(user, vote, note, poll, pollOwner) {
|
|
return {
|
|
id: `${config.url}/users/${user.id}#votes/${vote.id}/activity`,
|
|
actor: `${config.url}/users/${user.id}`,
|
|
type: "Create",
|
|
to: [
|
|
pollOwner.uri
|
|
],
|
|
published: new Date().toISOString(),
|
|
object: {
|
|
id: `${config.url}/users/${user.id}#votes/${vote.id}`,
|
|
type: "Note",
|
|
attributedTo: `${config.url}/users/${user.id}`,
|
|
to: [
|
|
pollOwner.uri
|
|
],
|
|
inReplyTo: note.uri,
|
|
name: poll.choices[vote.choice]
|
|
}
|
|
};
|
|
}
|