Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
0d810859
Commit
0d810859
authored
Feb 13, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
00ece798
Pipeline
#541
failed with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
crud.js
src/api/crud.js
+8
-7
No files found.
src/api/crud.js
View file @
0d810859
...
@@ -7,6 +7,7 @@ let cats = [
...
@@ -7,6 +7,7 @@ let cats = [
module
.
exports
=
{
module
.
exports
=
{
'/api/new'
:
{
'/api/new'
:
{
options
:
{},
method
:
'GET'
,
method
:
'GET'
,
summary
:
'Get list of new cards'
,
summary
:
'Get list of new cards'
,
fn
:
async
function
(
args
)
{
fn
:
async
function
(
args
)
{
...
@@ -17,15 +18,15 @@ module.exports = {
...
@@ -17,15 +18,15 @@ module.exports = {
method
:
'GET'
,
method
:
'GET'
,
summary
:
'Get card details'
,
summary
:
'Get card details'
,
options
:
{
options
:
{
categoryID
:
{
required
:
true
,
description
:
'ID of card category'
,
type
:
Number
},
categoryID
:
{
required
:
true
,
description
:
'ID of card category'
,
type
:
Number
},
cardID
:
{
required
:
true
,
description
:
'ID of card in category'
,
type
:
Number
}
cardID
:
{
required
:
true
,
description
:
'ID of card in category'
,
type
:
Number
}
},
},
fn
:
async
function
(
args
)
{
fn
:
async
function
(
args
)
{
let
searched
=
Object
.
values
(
data
.
products
).
filter
(
p
=>
p
.
id
===
args
.
cardID
&&
p
.
category_id
===
args
.
categoryID
);
let
searched
=
Object
.
values
(
data
.
products
).
filter
(
p
=>
p
.
id
===
args
.
cardID
&&
p
.
category_id
===
args
.
categoryID
);
if
(
searched
.
length
){
if
(
searched
.
length
){
return
searched
[
0
];
return
searched
[
0
];
}
else
{
}
else
{
throw
new
Error
(
'No matched product'
)
throw
new
Error
(
'No matched product'
)
}
}
}
}
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment