refactor(places): merge KML/KMZ routes into single POST /import/map endpoint

This commit is contained in:
Yannis Biasutti
2026-04-06 21:35:01 +02:00
parent 8c8bd5bc37
commit aacfd24b58
5 changed files with 21 additions and 47 deletions
+6 -6
View File
@@ -546,7 +546,7 @@ describe('KML/KMZ Import', () => {
.run('Museums', '#3b82f6', 'Landmark', user.id);
const res = await request(app)
.post(`/api/trips/${trip.id}/places/import/kml`)
.post(`/api/trips/${trip.id}/places/import/map`)
.set('Cookie', authCookie(user.id))
.attach('file', KML_FIXTURE);
@@ -572,7 +572,7 @@ describe('KML/KMZ Import', () => {
.run('Parks', '#22c55e', 'Trees', user.id);
const res = await request(app)
.post(`/api/trips/${trip.id}/places/import/kml`)
.post(`/api/trips/${trip.id}/places/import/map`)
.set('Cookie', authCookie(user.id))
.attach('file', KML_NESTED_FIXTURE);
@@ -596,7 +596,7 @@ describe('KML/KMZ Import', () => {
const trip = createTrip(testDb, user.id);
const res = await request(app)
.post(`/api/trips/${trip.id}/places/import/kml`)
.post(`/api/trips/${trip.id}/places/import/map`)
.set('Cookie', authCookie(user.id))
.attach('file', KML_MALFORMED_FIXTURE);
@@ -614,7 +614,7 @@ describe('KML/KMZ Import', () => {
const nonUtf8Kml = Buffer.concat([prefix, invalidByte, suffix]);
const res = await request(app)
.post(`/api/trips/${trip.id}/places/import/kml`)
.post(`/api/trips/${trip.id}/places/import/map`)
.set('Cookie', authCookie(user.id))
.attach('file', nonUtf8Kml, 'non-utf8.kml');
@@ -629,7 +629,7 @@ describe('KML/KMZ Import', () => {
const trip = createTrip(testDb, user.id);
const res = await request(app)
.post(`/api/trips/${trip.id}/places/import/kmz`)
.post(`/api/trips/${trip.id}/places/import/map`)
.set('Cookie', authCookie(user.id))
.attach('file', KMZ_FIXTURE);
@@ -643,7 +643,7 @@ describe('KML/KMZ Import', () => {
const trip = createTrip(testDb, user.id);
const res = await request(app)
.post(`/api/trips/${trip.id}/places/import/kmz`)
.post(`/api/trips/${trip.id}/places/import/map`)
.set('Cookie', authCookie(user.id))
.attach('file', Buffer.from('not-a-zip-archive'), 'invalid.kmz');