carnet api nc
This commit is contained in:
parent
e2f9ad574c
commit
97eb7f08f4
@ -237,6 +237,10 @@ export async function GET() {
|
|||||||
|
|
||||||
const folders: string[] = [];
|
const folders: string[] = [];
|
||||||
for (const response of responses) {
|
for (const response of responses) {
|
||||||
|
const resourceType = response.getElementsByTagName('d:resourcetype')[0];
|
||||||
|
const isCollection = resourceType?.getElementsByTagName('d:collection').length > 0;
|
||||||
|
|
||||||
|
if (isCollection) {
|
||||||
const href = response.getElementsByTagName('d:href')[0]?.textContent;
|
const href = response.getElementsByTagName('d:href')[0]?.textContent;
|
||||||
if (href) {
|
if (href) {
|
||||||
// Extract folder name from href
|
// Extract folder name from href
|
||||||
@ -246,6 +250,7 @@ export async function GET() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Parsed folders:', folders);
|
console.log('Parsed folders:', folders);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user