// Check if a note is archived before unarchivingconst noteId = 23;// First, get the note to check its statusconst checkResponse = await fetch(`https://arfan-notes.val.run/api/notes?id=${noteId}`);const notes = await checkResponse.json();if (notes.length > 0 && notes[0].archived) { // Note is archived, so we can unarchive it const unarchiveResponse = await fetch(`https://arfan-notes.val.run/api/notes/${noteId}/unarchive`, { method: 'PATCH', headers: { 'Content-Type': 'application/json' } }); const unarchivedNote = await unarchiveResponse.json(); console.log('Note unarchived:', unarchivedNote);} else { console.log('Note is not archived or does not exist');}