fix(samples): fix test case (#903)
This commit is contained in:
parent
d777fede90
commit
418256820d
@ -217,11 +217,11 @@ export default class ShopPlugin extends Plugin {
|
||||
name: 'orders',
|
||||
actions: {
|
||||
async deliver(ctx, next) {
|
||||
const { resourceIndex } = ctx.action.params;
|
||||
const { filterByTk } = ctx.action.params;
|
||||
const orderRepo = ctx.db.getRepository('orders');
|
||||
|
||||
const [order] = await orderRepo.update({
|
||||
filterByTk: resourceIndex,
|
||||
filterByTk,
|
||||
values: {
|
||||
status: 2,
|
||||
delivery: {
|
||||
|
@ -132,8 +132,8 @@ describe('shop actions', () => {
|
||||
expect(order.data.status).toEqual(0);
|
||||
|
||||
const { body: deliveredOrder } = await agent.resource('orders').deliver({
|
||||
filterByTk: order.data.id,
|
||||
values: {
|
||||
orderId: order.data.id,
|
||||
provider: 'SF',
|
||||
trackingNumber: '123456789'
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ describe('shop actions', () => {
|
||||
expect(order.data.status).toEqual(0);
|
||||
|
||||
const { body: deliveredOrder } = await agent.resource('orders').deliver({
|
||||
filterByTk: order.data.id,
|
||||
values: {
|
||||
orderId: order.data.id,
|
||||
provider: 'SF',
|
||||
trackingNumber: '123456789'
|
||||
}
|
||||
|
@ -72,11 +72,11 @@ export class ShopPlugin extends Plugin {
|
||||
fields: ['id', 'status', 'createdAt', 'updatedAt']
|
||||
},
|
||||
async deliver(ctx, next) {
|
||||
const { resourceIndex } = ctx.action.params;
|
||||
const { filterByTk } = ctx.action.params;
|
||||
const orderRepo = ctx.db.getRepository('orders');
|
||||
|
||||
const [order] = await orderRepo.update({
|
||||
filterByTk: resourceIndex,
|
||||
filterByTk,
|
||||
values: {
|
||||
status: 2,
|
||||
delivery: {
|
||||
|
Loading…
Reference in New Issue
Block a user