Mercure 在使用 SoftDeleatable 扩展时不更新 DELETE 方法

问题描述

对于一个项目,我使用 Api Platform 和 Mercure。我目前在使用 SoftDeleatable 扩展名时遇到问题。如果没有这个扩展,当我删除一个实体时,Mercure 会收到 DELETE。但是,如果我使用 SoftDeleatable 扩展名,删除是正确完成的,但 Mercure 没有收到 DELETE。

代码实体:

/**
 * @ORM\Entity(repositoryClass=MatchesRepository::class)
 * @Gedmo\SoftDeleteable(fieldName="deletedAt",timeAware=false,hardDelete=false)
 * @ApiResource(
 *     mercure=true,*     attributes={
 *          "normalization_context"={"groups"="read"},*          "denormalization_context"={"groups"="write"}
 *     },*     collectionoperations={
 *         "get",*         "post"={"security"="is_granted('ROLE_USER')"}
 *     },*     itemOperations={
 *         "get",*         "put"={"security"="is_granted('ROLE_ADMIN') or object.owner == user"},*         "delete"={
 *              "security"="is_granted('ROLE_ADMIN') or object.owner == user"
 *          },*     }
 * )
 */
class Matches
{

刚刚添加了 mercure=true 以启用 mercure

PS:我不测试更改 DELETE 函数是否有效,但 SoftDeleatable 正常执行:/

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)