Przeglądaj źródła

comment count

master
Daniel 1 rok temu
rodzic
commit
df3404fe63
4 zmienionych plików z 16 dodań i 1 usunięć
  1. +1
    -1
      export/openapi.json
  2. +12
    -0
      export/openapi.yaml
  3. +1
    -0
      src/ApiResource/PostingApi.php
  4. +2
    -0
      src/Mapper/PostingEntityToApiMapper.php

+ 1
- 1
export/openapi.json
Plik diff jest za duży
Wyświetl plik


+ 12
- 0
export/openapi.yaml Wyświetl plik

@@ -5450,6 +5450,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:
@@ -5581,6 +5585,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:
@@ -5719,6 +5727,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:


+ 1
- 0
src/ApiResource/PostingApi.php Wyświetl plik

@@ -173,6 +173,7 @@ class PostingApi implements OwnerInterface
#[Groups(['posting:create'])]
public ?SaleApi $saleIri = null;

public ?int $numComments = null;

#[ApiProperty(writable: false)]
public ?\DateTimeImmutable $createdAt = null;


+ 2
- 0
src/Mapper/PostingEntityToApiMapper.php Wyświetl plik

@@ -68,6 +68,8 @@ class PostingEntityToApiMapper implements MapperInterface
]);
}

$dto->numComments = count($entity->getComments());

$dto->createdAt = $entity->getCreatedAt();

return $dto;


Ładowanie…
Anuluj
Zapisz