File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,14 @@ export const websitesRouter = createTRPCRouter({
222222 . where ( eq ( websites . id , input . websiteId ) )
223223 . returning ( ) ;
224224
225- logger . info (
225+ if ( ! updatedWebsite ) {
226+ throw new TRPCError ( {
227+ code : 'NOT_FOUND' ,
228+ message : 'Website not found' ,
229+ } ) ;
230+ }
231+
232+ logger . success (
226233 'Website Transferred' ,
227234 `Website "${ updatedWebsite . name } " was transferred to organization "${ input . organizationId } "` ,
228235 {
@@ -232,9 +239,7 @@ export const websitesRouter = createTRPCRouter({
232239 }
233240 ) ;
234241
235- // Invalidate cache for this user's websites
236242 await drizzleCache . invalidateByTables ( [ 'websites' ] ) ;
237- // Invalidate getById cache for this website
238243 await drizzleCache . invalidateByKey ( `getById:${ input . websiteId } ` ) ;
239244
240245 return updatedWebsite ;
You can’t perform that action at this time.
0 commit comments