From 65ce7d460be34c8d02ea483905fed03dae4b20aa Mon Sep 17 00:00:00 2001 From: alma Date: Tue, 6 May 2025 17:18:33 +0200 Subject: [PATCH] missions api2 --- lib/services/outline-service.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/services/outline-service.ts b/lib/services/outline-service.ts index 05712175..2a03d280 100644 --- a/lib/services/outline-service.ts +++ b/lib/services/outline-service.ts @@ -19,19 +19,12 @@ export class OutlineService { try { // Create a collection in Outline based on the mission const response = await axios.post( - `${this.apiUrl}/collections`, + `${this.apiUrl}/collections.create`, { name: mission.label, description: mission.description || 'Mission documentation', - color: '#4f46e5', // Indigo color as default - permission: 'read_write', - // Added extra fields that might be useful for identifying the collection - private: false, - external: true, - meta: { - missionId: mission.id, - createdAt: new Date().toISOString() - } + color: '#4f46e5', // Indigo color as default, + permission: 'read_write' }, { headers: { @@ -41,8 +34,12 @@ export class OutlineService { } ); + console.log('Outline API response:', JSON.stringify(response.data, null, 2)); + if (response.data && response.data.data && response.data.data.id) { return response.data.data.id; + } else if (response.data && response.data.id) { + return response.data.id; } else { throw new Error('Failed to get collection ID from Outline API response'); } @@ -70,8 +67,11 @@ export class OutlineService { try { // Delete the collection in Outline - await axios.delete( - `${this.apiUrl}/collections/${collectionId}`, + await axios.post( + `${this.apiUrl}/collections.delete`, + { + id: collectionId + }, { headers: { 'Content-Type': 'application/json',