PMPR-44 : fix formatting
This commit is contained in:
@@ -5,7 +5,7 @@ import { db } from "../../../../../databases/db.ts";
|
|||||||
import { notes } from "../../../../../databases/schema.ts";
|
import { notes } from "../../../../../databases/schema.ts";
|
||||||
|
|
||||||
export const handler: Handlers = {
|
export const handler: Handlers = {
|
||||||
// # 44 POST /notes/import-xlsx
|
//# 44 POST /notes/import-xlsx
|
||||||
async POST(request) {
|
async POST(request) {
|
||||||
try {
|
try {
|
||||||
const formData = await request.formData();
|
const formData = await request.formData();
|
||||||
@@ -23,7 +23,10 @@ export const handler: Handlers = {
|
|||||||
const buffer = await file.arrayBuffer();
|
const buffer = await file.arrayBuffer();
|
||||||
const workbook = XLSX.read(buffer);
|
const workbook = XLSX.read(buffer);
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||||
const rows = XLSX.utils.sheet_to_json(sheet) as { numEtud: number; note: number }[];
|
const rows = XLSX.utils.sheet_to_json(sheet) as {
|
||||||
|
numEtud: number;
|
||||||
|
note: number;
|
||||||
|
}[];
|
||||||
|
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
const { numEtud, note } = row;
|
const { numEtud, note } = row;
|
||||||
|
|||||||
Reference in New Issue
Block a user