@@ -154,14 +154,8 @@ export const gameplayRouter = router({
154154 )
155155 . output ( GameplaySchema )
156156 . mutation ( async ( { input, ctx } ) => {
157- const transaction = Sentry . startTransaction ( {
158- op : 'createGameplay' ,
159- name : 'Create a new gameplay' ,
160- } ) ;
161-
162157 const isPerson = await vUser ( input . tsToken ) ;
163158 if ( ! isPerson ) {
164- transaction . finish ( ) ;
165159 throw new TRPCError ( {
166160 code : 'BAD_REQUEST' ,
167161 message :
@@ -178,7 +172,6 @@ export const gameplayRouter = router({
178172
179173 // this needs to be handled client side
180174 if ( existingGameplay !== null ) {
181- transaction . finish ( ) ;
182175 throw new TRPCError ( {
183176 code : 'BAD_REQUEST' ,
184177 message : 'This youtube url has already been submitted.' ,
@@ -189,7 +182,6 @@ export const gameplayRouter = router({
189182 / ^ (?: h t t p s ? : \/ \/ ) ? (?: m \. | w w w \. ) ? (?: y o u t u \. b e \/ | y o u t u b e \. c o m \/ (?: e m b e d \/ | v \/ | w a t c h \? v = | w a t c h \? .+ & v = ) ) ( ( \w | - ) { 11 } ) (?: \S + ) ? $ / ;
190183
191184 if ( ! input . youtubeUrl . match ( isValid ) ) {
192- transaction . finish ( ) ;
193185 throw new TRPCError ( {
194186 code : 'BAD_REQUEST' ,
195187 message : 'This url does not seem to be from youtube.' ,
@@ -222,10 +214,8 @@ export const gameplayRouter = router({
222214 cheats : input . cheats ,
223215 } ,
224216 } ) ;
225- transaction . finish ( ) ;
226217 return data ;
227218 } catch ( error ) {
228- transaction . finish ( ) ;
229219 Sentry . captureException ( error ) ;
230220 throw new TRPCError ( {
231221 code : 'INTERNAL_SERVER_ERROR' ,
@@ -475,10 +465,6 @@ export const gameplayRouter = router({
475465 )
476466 . output ( ReviewItemsGameplaySchema )
477467 . query ( async ( { input, ctx } ) => {
478- const transaction = Sentry . startTransaction ( {
479- op : 'getReviewItems' ,
480- name : 'Get Review Items' ,
481- } ) ;
482468 const itemCount = await ctx . prisma . gameplay . count ( ) ;
483469 const reviewItem = await ctx . prisma . gameplay . findMany ( {
484470 where : {
@@ -507,7 +493,6 @@ export const gameplayRouter = router({
507493 } ,
508494 } ) ;
509495 if ( reviewItem [ 0 ] == null || reviewItem [ 0 ] == undefined ) {
510- transaction . finish ( ) ;
511496 throw new TRPCError ( { code : 'NOT_FOUND' } ) ;
512497 } else {
513498 Object . assign ( reviewItem [ 0 ] , {
@@ -518,7 +503,6 @@ export const gameplayRouter = router({
518503 } ,
519504 } ) ;
520505 Object . assign ( reviewItem [ 0 ] , { total : itemCount } ) ;
521- transaction . finish ( ) ;
522506 return reviewItem [ 0 ] as ReviewItemOutput ;
523507 }
524508 } ) ,
@@ -534,13 +518,8 @@ export const gameplayRouter = router({
534518 )
535519 . output ( z . object ( { message : z . string ( ) } ) )
536520 . mutation ( async ( { input, ctx } ) => {
537- const transaction = Sentry . startTransaction ( {
538- op : 'review' ,
539- name : 'Review' ,
540- } ) ;
541521 const isPerson = await vUser ( input . tsToken ) ;
542522 if ( ! isPerson ) {
543- transaction . finish ( ) ;
544523 throw new TRPCError ( {
545524 code : 'BAD_REQUEST' ,
546525 message :
@@ -558,14 +537,11 @@ export const gameplayRouter = router({
558537 } ,
559538 } ) ;
560539 if ( ! footageVote ) {
561- transaction . finish ( ) ;
562540 throw new TRPCError ( {
563541 code : 'NOT_FOUND' ,
564542 message : `Could not find a gameplay document with id:${ input . gameplayId } .` ,
565543 } ) ;
566544 }
567-
568- transaction . finish ( ) ;
569545 return { message : 'Updated the gameplay document successfully.' } ;
570546 } ) ,
571547} ) ;
0 commit comments