Add embryo to products

This commit is contained in:
Niklas Fondberg
2021-04-06 15:49:41 +02:00
parent 813f4c8e47
commit 949c641410
10 changed files with 110 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
import { SQLDataSource } from 'datasource-sql';
import * as sql from './sql';
const MINUTE = 60;
export class ProductAPI extends SQLDataSource {
constructor(config) {
super(config);
}
async getProducts() {
const query = sql.products(true, true, 2);
const data = await this.knex.raw(query);
console.log(JSON.stringify(data.rows[0], null, 2));
return [
{ id: 1, artNo: 'SE' },
{ id: 2, artNo: 'DK' },
];
}
}