From 19fef91d29af69636a35e56afa250235b3365ec0 Mon Sep 17 00:00:00 2001 From: Phoenix Date: Wed, 18 Sep 2019 10:31:22 +0100 Subject: [PATCH] Creating skeleton for active symbol --- src/api/active-symbol.js | 23 +++++++++++++++++++++++ src/router/index.js | 22 ++++++++++++++++++++++ src/views/active-symbol/create.js | 0 src/views/active-symbol/list.js | 0 4 files changed, 45 insertions(+) create mode 100644 src/api/active-symbol.js create mode 100644 src/views/active-symbol/create.js create mode 100644 src/views/active-symbol/list.js diff --git a/src/api/active-symbol.js b/src/api/active-symbol.js new file mode 100644 index 00000000..8674252f --- /dev/null +++ b/src/api/active-symbol.js @@ -0,0 +1,23 @@ +import axios from 'axios' + +const apiUrl = 'https://localhost:3000' + +export function fetchActiveSymbols() { + return axios.get(`${apiUrl}/symbol/future/active/`) +} + +export function createActiveSymbol(data) { + const dto = { + 'type': data.type, + 'start_date': data.start_date, + 'symbol': data.symbol + } + if (data.allow_retroactive_data) dto.allow_retroactive_data = data.allow_retroactive_data + if (data.platform) dto.platform = data.platform + + axios.put(`${apiUrl}/symbol/future/active`, dto) +} + +export function deleteActiveSymbol(id) { + axios.delete(`${apiUrl}/symbol/future/active?id=${id}`) +} diff --git a/src/router/index.js b/src/router/index.js index 07a507ab..2872769c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -236,6 +236,28 @@ export const asyncRoutes = [ } ] }, + { path: '/activesymbol', + component: Layout, + name: 'Ice Pricing', + meta: { + title: 'Ice Pricing', + icon: 'example' + }, + children: [ + { + path: 'create', + component: () => import('@/views/active-symbol/create'), + name: 'CreateActiveSymbol', + meta: { title: 'Create Active Pricing', icon: 'edit' } + }, + { + path: 'list', + component: () => import('@/views/active-symbol/list'), + name: 'ActiveSymbolList', + meta: { title: 'Ice Pricing List', icon: 'list' } + } + ] + }, { path: '/products', component: Layout, diff --git a/src/views/active-symbol/create.js b/src/views/active-symbol/create.js new file mode 100644 index 00000000..e69de29b diff --git a/src/views/active-symbol/list.js b/src/views/active-symbol/list.js new file mode 100644 index 00000000..e69de29b