u
This commit is contained in:
14
src/store/category/create.js
Normal file
14
src/store/category/create.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import sql from 'mssql';
|
||||
import { CREATE } from '../../sql/category.js';
|
||||
|
||||
export default function create(pool) {
|
||||
return async ({ parent_id, sort }) => {
|
||||
const result = await pool
|
||||
.request()
|
||||
.input('parentId', sql.Int, parent_id)
|
||||
.input('sort', sql.Int, sort)
|
||||
.query(CREATE);
|
||||
|
||||
return result.recordset[0].id;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user