widget parole 8
This commit is contained in:
parent
d067017a8e
commit
7e2151b5ff
@ -108,13 +108,18 @@ export async function GET(request: Request) {
|
||||
});
|
||||
|
||||
// Get user's subscriptions using admin token
|
||||
const subscriptionsResponse = await fetch(`${baseUrl}/api/v1/subscriptions.list`, {
|
||||
const subscriptionsResponse = await fetch(`${baseUrl}/api/v1/subscriptions.get`, {
|
||||
method: 'GET',
|
||||
headers: adminHeaders
|
||||
headers: {
|
||||
...adminHeaders,
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
if (!subscriptionsResponse.ok) {
|
||||
console.error('Failed to get subscriptions:', subscriptionsResponse.status);
|
||||
const errorText = await subscriptionsResponse.text();
|
||||
console.error('Subscriptions error details:', errorText);
|
||||
return new Response(JSON.stringify({ error: 'Failed to get subscriptions' }), {
|
||||
status: subscriptionsResponse.status,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@ -150,13 +155,18 @@ export async function GET(request: Request) {
|
||||
try {
|
||||
// Get the latest messages from the room
|
||||
const messagesResponse = await fetch(
|
||||
`${baseUrl}/api/v1/channels.messages?roomId=${subscription.rid}&count=1`, {
|
||||
`${baseUrl}/api/v1/chat.getMessage?roomId=${subscription.rid}`, {
|
||||
method: 'GET',
|
||||
headers: adminHeaders
|
||||
headers: {
|
||||
...adminHeaders,
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
if (!messagesResponse.ok) {
|
||||
console.error(`Failed to get messages for room ${subscription.name}:`, messagesResponse.status);
|
||||
const errorText = await messagesResponse.text();
|
||||
console.error(`Messages error details for ${subscription.name}:`, errorText);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user