forked from yug49/Rann
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix.js
More file actions
19 lines (15 loc) · 759 Bytes
/
fix.js
File metadata and controls
19 lines (15 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const fs = require('fs');
const path = require('path');
const filePath = '/Users/shubhtastic/Documents/cyfrin_web3/Rann/frontend/src/pages/api/arena/[battleId].ts';
let content = fs.readFileSync(filePath, 'utf8');
// Change getKurukshetraContractAddress function to directly return the battleId
content = content.replace(
/async function getKurukshetraContractAddress\(battleId: string\): Promise<string \| null> {[\s\S]*?}/,
`async function getKurukshetraContractAddress(battleId: string): Promise<string | null> {
// DIRECTLY USE BATTLEID AS CONTRACT ADDRESS - NO QUESTIONS ASKED
console.log(\`📍 Using battleId directly: \${battleId}\`);
return battleId;
}`
);
fs.writeFileSync(filePath, content);
console.log('File updated successfully');