fix: 404 response (#1156)
This commit is contained in:
parent
7b5277fb2a
commit
3be27c262f
@ -96,6 +96,7 @@ describe('remove action', () => {
|
||||
values: [t1.get('id')],
|
||||
});
|
||||
|
||||
expect(response.status).toEqual(200);
|
||||
expect(await p1.countTags()).toEqual(1);
|
||||
});
|
||||
|
||||
@ -112,10 +113,7 @@ describe('remove action', () => {
|
||||
const postProfile = await Profile.repository.findOne();
|
||||
expect(await postProfile.getPost()).not.toBeNull();
|
||||
|
||||
const response = await app
|
||||
.agent()
|
||||
.resource('posts.profile', p1.get('id'))
|
||||
.remove();
|
||||
const response = await app.agent().resource('posts.profile', p1.get('id')).remove();
|
||||
|
||||
await postProfile.reload();
|
||||
expect(await postProfile.getPost()).toBeNull();
|
||||
|
@ -16,6 +16,8 @@ export function RelationRepositoryActionBuilder(method: 'remove' | 'set') {
|
||||
const repository = getRepositoryFromParams(ctx);
|
||||
|
||||
await repository[method](ctx.action.params.values);
|
||||
|
||||
ctx.status = 200;
|
||||
await next();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user