All checks were successful
Deploy production / deploy (push) Successful in 1m26s
18 lines
634 B
TypeScript
18 lines
634 B
TypeScript
import { requireOwner } from '#lib/server/owner.js';
|
|
import { channelRows } from '#lib/server/radio.js';
|
|
import { scannerCsv } from '#lib/radio/index.js';
|
|
import type { RequestHandler } from './$types';
|
|
|
|
// All 500 scanner memories as CSV (Uniden BC125AT/UBC125XLT programming software column order).
|
|
export const GET: RequestHandler = async (event) => {
|
|
requireOwner(event);
|
|
const csv = scannerCsv(await channelRows());
|
|
return new Response(csv, {
|
|
headers: {
|
|
'content-type': 'text/csv; charset=utf-8',
|
|
'content-disposition': 'attachment; filename="ubc125xlt-banks.csv"',
|
|
'cache-control': 'private, no-store'
|
|
}
|
|
});
|
|
};
|