fix: cannot delete resource when you are not on root team
This commit is contained in:
		@@ -736,7 +736,7 @@ export async function deleteApplication(
 | 
				
			|||||||
			where: { id },
 | 
								where: { id },
 | 
				
			||||||
			include: { destinationDocker: true, teams: true }
 | 
								include: { destinationDocker: true, teams: true }
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		if (teamId !== '0' || !application.teams.some((team) => team.id === teamId)) {
 | 
							if (teamId !== '0' && !application.teams.some((team) => team.id === teamId)) {
 | 
				
			||||||
			throw { status: 403, message: 'You are not allowed to delete this application.' };
 | 
								throw { status: 403, message: 'You are not allowed to delete this application.' };
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (application?.destinationDocker?.id && application.destinationDocker?.network) {
 | 
							if (application?.destinationDocker?.id && application.destinationDocker?.network) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user