Daniel 2 anni fa
parent
commit
88f27c0936
3 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. +1
    -0
      README.md
  2. +6
    -3
      config/packages/nelmio_cors.yaml
  3. +1
    -1
      src/ApiResource/PostingApi.php

+ 1
- 0
README.md Vedi File

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

ddev exec php bin/phpunit --filter=testPostToCreateNewUserPost

ddev composer require --dev mtdowling/jmespath.php


+ 6
- 3
config/packages/nelmio_cors.yaml Vedi File

@@ -1,10 +1,13 @@
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
# allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
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
paths:
'^/': null

+ 1
- 1
src/ApiResource/PostingApi.php Vedi File

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


Caricamento…
Annulla
Salva