allow comment updates when they have boost
This commit is contained in:
parent
e323ed27c6
commit
020b4c5eea
|
@ -49,7 +49,7 @@ export async function onPaid ({ invoice, actId }, { models, tx }) {
|
|||
})
|
||||
itemAct = await tx.itemAct.findFirst({ where: { invoiceId: invoice.id } })
|
||||
} else if (actId) {
|
||||
itemAct = await tx.itemAct.findFirst({ where: { id: { in: actId } } })
|
||||
itemAct = await tx.itemAct.findFirst({ where: { id: actId } })
|
||||
} else {
|
||||
throw new Error('No invoice or actId')
|
||||
}
|
||||
|
|
|
@ -1375,7 +1375,7 @@ export const updateItem = async (parent, { sub: subName, forward, hash, hmac, ..
|
|||
item = { id: Number(item.id), text: item.text, title: `@${user.name}'s bio` }
|
||||
} else if (old.parentId) {
|
||||
// prevent editing a comment like a post
|
||||
item = { id: Number(item.id), text: item.text }
|
||||
item = { id: Number(item.id), text: item.text, boost: item.boost }
|
||||
} else {
|
||||
item = { subName, ...item }
|
||||
item.forwardUsers = await getForwardUsers(models, forward)
|
||||
|
|
|
@ -57,7 +57,7 @@ export default gql`
|
|||
id: ID, sub: String, title: String!, text: String, options: [String!]!, boost: Int, forward: [ItemForwardInput], pollExpiresAt: Date,
|
||||
hash: String, hmac: String): ItemPaidAction!
|
||||
updateNoteId(id: ID!, noteId: String!): Item!
|
||||
upsertComment(id: ID, text: String!, parentId: ID, hash: String, hmac: String): ItemPaidAction!
|
||||
upsertComment(id: ID, text: String!, parentId: ID, boost: Int, hash: String, hmac: String): ItemPaidAction!
|
||||
act(id: ID!, sats: Int, act: String, idempotent: Boolean): ItemActPaidAction!
|
||||
pollVote(id: ID!): PollVotePaidAction!
|
||||
toggleOutlaw(id: ID!): Item!
|
||||
|
|
|
@ -44,7 +44,7 @@ export default function useItemSubmit (mutation,
|
|||
variables: {
|
||||
id: item?.id,
|
||||
sub: item?.subName || sub?.name,
|
||||
boost: boost ? Number(boost) : undefined,
|
||||
boost: boost ? Number(boost) : item?.boost ? Number(item.boost) : undefined,
|
||||
bounty: bounty ? Number(bounty) : undefined,
|
||||
status: status === 'STOPPED' ? 'STOPPED' : 'ACTIVE',
|
||||
title: title?.trim(),
|
||||
|
|
|
@ -218,8 +218,8 @@ export const CREATE_COMMENT = gql`
|
|||
export const UPDATE_COMMENT = gql`
|
||||
${ITEM_PAID_ACTION_FIELDS}
|
||||
${PAID_ACTION}
|
||||
mutation upsertComment($id: ID!, $text: String!, ${HASH_HMAC_INPUT_1}) {
|
||||
upsertComment(id: $id, text: $text, ${HASH_HMAC_INPUT_2}) {
|
||||
mutation upsertComment($id: ID!, $text: String!, $boost: Int, ${HASH_HMAC_INPUT_1}) {
|
||||
upsertComment(id: $id, text: $text, boost: $boost, ${HASH_HMAC_INPUT_2}) {
|
||||
...ItemPaidActionFields
|
||||
...PaidActionFields
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue