Commit bd5797e4 authored by Aleh's avatar Aleh 🐳
Browse files

fix schema

parent be9acd30
......@@ -53,7 +53,7 @@ app.post(`/api/v1/synchronizer/datalist`, wrap(async (req, res) => {
app.post(`/api/v1/synchronizer/data`, wrap(async (req, res) => {
const {requestedType, filter} = req.body;
if (requestedType !== `holidays`) {
if (requestedType !== `holiday`) {
throw new Error(`Only holidays database can be synchronized`);
}
if (_.isEmpty(filter.countries)) {
......
{
"schema": {
"holidays": {
"holiday": {
"id": {
"name": "Id",
"type": "id"
......@@ -18,5 +17,4 @@
"type": "text"
}
}
}
}
......@@ -37,14 +37,14 @@ describe(`integration app suite`, function () {
});
it(`should have schema holidays type defined`, async () => {
const {body: {schema: {holidays}}} = await request(app).post(`/api/v1/synchronizer/schema`)
.expect(200).expect(`Content-Type`, /json/);
assert.deepEqual(holidays.id, {name: `Id`, type: `id`});
const {body: {holiday}} = await request(app).post(`/api/v1/synchronizer/schema`)
.send().expect(200).expect(`Content-Type`, /json/);
assert.deepEqual(holiday.id, {name: `Id`, type: `id`});
});
it(`should return data for CY`, async () => {
const {body: {items}} = await request(app).post(`/api/v1/synchronizer/data`).send({
requestedType: `holidays`,
requestedType: `holiday`,
filter: {
countries: [`CY`]
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment