File tree Expand file tree Collapse file tree 2 files changed +0
-37
lines changed Expand file tree Collapse file tree 2 files changed +0
-37
lines changed Original file line number Diff line number Diff line change @@ -1095,42 +1095,6 @@ export default {
1095
1095
1096
1096
return result
1097
1097
} ,
1098
- cancelScheduledPost : async ( parent , { id } , { me, models } ) => {
1099
- if ( ! me ) {
1100
- throw new GqlAuthenticationError ( )
1101
- }
1102
-
1103
- const item = await models . item . findUnique ( {
1104
- where : { id : Number ( id ) }
1105
- } )
1106
-
1107
- if ( ! item ) {
1108
- throw new GqlInputError ( 'item not found' )
1109
- }
1110
-
1111
- if ( Number ( item . userId ) !== Number ( me . id ) ) {
1112
- throw new GqlInputError ( 'item does not belong to you' )
1113
- }
1114
-
1115
- if ( ! item . scheduledAt ) {
1116
- throw new GqlInputError ( 'item is not scheduled' )
1117
- }
1118
-
1119
- // Cancel the scheduled job
1120
- await models . $queryRaw `
1121
- DELETE FROM pgboss.job
1122
- WHERE name = 'publishScheduledPost'
1123
- AND data->>'itemId' = ${ item . id } ::TEXT
1124
- AND state <> 'completed'`
1125
-
1126
- // Update the item to remove scheduling
1127
- return await models . item . update ( {
1128
- where : { id : Number ( id ) } ,
1129
- data : {
1130
- scheduledAt : null
1131
- }
1132
- } )
1133
- } ,
1134
1098
publishScheduledPostNow : async ( parent , { id } , { me, models } ) => {
1135
1099
if ( ! me ) {
1136
1100
throw new GqlAuthenticationError ( )
Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ export default gql`
64
64
act(id: ID!, sats: Int, act: String, hasSendWallet: Boolean): ItemActPaidAction!
65
65
pollVote(id: ID!): PollVotePaidAction!
66
66
toggleOutlaw(id: ID!): Item!
67
- cancelScheduledPost(id: ID!): Item!
68
67
publishScheduledPostNow(id: ID!): Item!
69
68
}
70
69
You can’t perform that action at this time.
0 commit comments