fix: 404 response (#1156)

This commit is contained in:
ChengLei Shao 2022-11-28 17:27:12 +08:00 committed by GitHub
parent 7b5277fb2a
commit 3be27c262f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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();

View File

@ -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();
};
}