use uuid instead of playername to query player
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				delpoy / build-and-deploy (push) Successful in 1m0s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	delpoy / build-and-deploy (push) Successful in 1m0s
				
			This commit is contained in:
		| @@ -6,14 +6,19 @@ export const GET = (async ({ url }) => { | ||||
| 	if (env.REPORT_SECRET && url.searchParams.get('secret') !== env.REPORT_SECRET) | ||||
| 		return new Response(null, { status: 401 }); | ||||
|  | ||||
| 	const username = url.searchParams.get('username'); | ||||
| 	if (username == null) return new Response(null, { status: 400 }); | ||||
| 	const uuid = url.searchParams.get('uuid'); | ||||
| 	if (uuid == null) return new Response(null, { status: 400 }); | ||||
|  | ||||
| 	const user = await User.findOne({ where: { username: username } }); | ||||
| 	const user = await User.findOne({ where: { uuid: uuid } }); | ||||
| 	if (user == null) return new Response(null, { status: 400 }); | ||||
|  | ||||
| 	return new Response( | ||||
| 		JSON.stringify({ uuid: user.uuid, firstname: user.firstname, lastname: user.lastname }), | ||||
| 		JSON.stringify({ | ||||
| 			uuid: user.uuid, | ||||
| 			username: user.username, | ||||
| 			firstname: user.firstname, | ||||
| 			lastname: user.lastname | ||||
| 		}), | ||||
| 		{ status: 200 } | ||||
| 	); | ||||
| }) satisfies RequestHandler; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user