vue_activity location: add NewLocation fields, submit activity form with hidden field (+)

This commit is contained in:
2021-10-15 09:09:47 +02:00
parent 4d4662a634
commit e6845326d7
9 changed files with 175 additions and 11 deletions

View File

@@ -461,6 +461,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_POST => true,
]
],

View File

@@ -9,10 +9,14 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
/**
* @ORM\Table(name="chill_main_location")
* @ORM\Entity(repositoryClass=LocationRepository::class)
* @DiscriminatorMap(typeProperty="type", mapping={
* "location"=Location::class
* })
*/
class Location implements TrackCreationInterface, TrackUpdateInterface
{

View File

@@ -5,10 +5,14 @@ namespace Chill\MainBundle\Entity;
use Chill\MainBundle\Repository\LocationTypeRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
/**
* @ORM\Table(name="chill_main_location_type")
* @ORM\Entity(repositoryClass=LocationTypeRepository::class)
* @DiscriminatorMap(typeProperty="type", mapping={
* "location-type"=LocationType::class
* })
*/
class LocationType
{

View File

@@ -548,6 +548,48 @@ paths:
description: "ok"
401:
description: "Unauthorized"
post:
tags:
- location
summary: create a new location
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
type:
type: string
name:
type: string
phonenumber1:
type: string
phonenumber2:
type: string
email:
type: string
address:
type: object
properties:
id:
type: integer
locationtype:
type: object
properties:
id:
type: integer
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "Unprocessable entity (validation errors)"
400:
description: "transition cannot be applyed"
/1.0/main/location-type.json:
get: