drag & drop renewed, imageCropper revisited, imageOrder persisted, css quirks
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
import fs from 'fs-extra';
|
||||
import { selectFiles } from './filechooser.js';
|
||||
import path from 'path';
|
||||
|
||||
(async () => {
|
||||
const listings = await fs.readJson('./listings.json');
|
||||
const result = await selectFiles({startingPath:'./data',directoryFilter: (directoryName)=>{
|
||||
return false;
|
||||
},fileFilter: (fileName) => {
|
||||
return /\.json$/gi.test(fileName);
|
||||
},pageSize:10,multi:false});
|
||||
console.log(result['selectedFiles'][0]);
|
||||
const file = result['selectedFiles'][0];
|
||||
// const extension = path.extname(file);
|
||||
// const basefileName = path.basename(file,extension);
|
||||
const listings = await fs.readJson(file);
|
||||
//listings.forEach(element => {
|
||||
for (const listing of listings) {
|
||||
const response = await fetch('http://localhost:3000/bizmatch/listings', {
|
||||
const type = listing.listingsCategory
|
||||
const response = await fetch(`http://localhost:3000/bizmatch/listings/${type}`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(listing),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
||||
Reference in New Issue
Block a user