瀏覽代碼

wip

master
Daniel 2 年之前
父節點
當前提交
88f27c0936
共有 3 個檔案被更改,包括 8 行新增4 行删除
  1. +1
    -0
      README.md
  2. +6
    -3
      config/packages/nelmio_cors.yaml
  3. +1
    -1
      src/ApiResource/PostingApi.php

+ 1
- 0
README.md 查看文件

@@ -79,6 +79,7 @@
<extensions> <extensions>
<extension class="Zenstruck\Browser\Test\BrowserExtension" /> <extension class="Zenstruck\Browser\Test\BrowserExtension" />
</extensions> </extensions>

ddev exec php bin/phpunit --filter=testPostToCreateNewUserPost ddev exec php bin/phpunit --filter=testPostToCreateNewUserPost


ddev composer require --dev mtdowling/jmespath.php ddev composer require --dev mtdowling/jmespath.php


+ 6
- 3
config/packages/nelmio_cors.yaml 查看文件

@@ -1,10 +1,13 @@
nelmio_cors: nelmio_cors:
defaults: defaults:
origin_regex: true origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
# allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE'] allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type', 'Authorization']
expose_headers: ['Link']
# allow_headers: ['Content-Type', 'Authorization']
# expose_headers: ['Link']
expose_headers: ['*']
allow_origin: [ '*' ]
allow_headers: [ '*' ]
max_age: 3600 max_age: 3600
paths: paths:
'^/': null '^/': null

+ 1
- 1
src/ApiResource/PostingApi.php 查看文件

@@ -39,7 +39,7 @@ use Symfony\Component\Validator\Constraints\NotBlank;
) )
], ],
paginationItemsPerPage: 10, paginationItemsPerPage: 10,
security: 'is_granted("ROLE_USER")',
// security: 'is_granted("ROLE_USER")',
provider: EntityToDtoStateProvider::class, provider: EntityToDtoStateProvider::class,
processor: EntityClassDtoStateProcessor::class, processor: EntityClassDtoStateProcessor::class,
stateOptions: new Options(entityClass: Posting::class), stateOptions: new Options(entityClass: Posting::class),


Loading…
取消
儲存