File size: 1,304 Bytes
384fef6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
    <title>Test Share Link Generation</title>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
    <h1>Test Share Link Generation</h1>
    <button onclick="testShareLink()">Generate Share Link</button>
    <div id="result"></div>

    <script>
        async function testShareLink() {
            const resultDiv = document.getElementById('result');
            resultDiv.innerHTML = 'Testing...';
            
            try {
                const response = await axios.post('/api/public/generate-share-link', {
                    userId: 'user_1735716399333',
                    pptId: 'ppt_1735716399333',
                    slideIndex: 0
                });
                
                resultDiv.innerHTML = `
                    <h3>Success!</h3>
                    <pre>${JSON.stringify(response.data, null, 2)}</pre>
                `;
            } catch (error) {
                resultDiv.innerHTML = `
                    <h3>Error!</h3>
                    <p>Status: ${error.response?.status}</p>
                    <p>Message: ${error.message}</p>
                    <pre>${JSON.stringify(error.response?.data, null, 2)}</pre>
                `;
            }
        }
    </script>
</body>
</html>