mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
overwrite decodedDefault with the default
This commit is contained in:
parent
12d2c80431
commit
e904fa6f9d
6 changed files with 11 additions and 11 deletions
|
|
@ -74,7 +74,7 @@ class Create extends Action
|
||||||
|
|
||||||
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
|
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
|
||||||
{
|
{
|
||||||
$decodedDefault = \is_string($default) ? \json_decode($default, true) : $default;
|
$default = \is_string($default) ? \json_decode($default, true) : $default;
|
||||||
|
|
||||||
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
|
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class Update extends Action
|
||||||
|
|
||||||
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
|
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
|
||||||
{
|
{
|
||||||
$decodedDefault = \is_string($default) ? \json_decode($default, true) : $default;
|
$default = \is_string($default) ? \json_decode($default, true) : $default;
|
||||||
|
|
||||||
$attribute = $this->updateAttribute(
|
$attribute = $this->updateAttribute(
|
||||||
databaseId: $databaseId,
|
databaseId: $databaseId,
|
||||||
|
|
@ -83,7 +83,7 @@ class Update extends Action
|
||||||
dbForProject: $dbForProject,
|
dbForProject: $dbForProject,
|
||||||
queueForEvents: $queueForEvents,
|
queueForEvents: $queueForEvents,
|
||||||
type: Database::VAR_LINESTRING,
|
type: Database::VAR_LINESTRING,
|
||||||
default: $decodedDefault,
|
default: $default,
|
||||||
required: $required,
|
required: $required,
|
||||||
newKey: $newKey
|
newKey: $newKey
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ class Create extends Action
|
||||||
|
|
||||||
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
|
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
|
||||||
{
|
{
|
||||||
$decodedDefault = \is_string($default) ? \json_decode($default, true) : $default;
|
$default = \is_string($default) ? \json_decode($default, true) : $default;
|
||||||
|
|
||||||
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
|
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'type' => Database::VAR_POINT,
|
'type' => Database::VAR_POINT,
|
||||||
'required' => $required,
|
'required' => $required,
|
||||||
'default' => $decodedDefault,
|
'default' => $default,
|
||||||
]), $response, $dbForProject, $queueForDatabase, $queueForEvents);
|
]), $response, $dbForProject, $queueForDatabase, $queueForEvents);
|
||||||
|
|
||||||
$response
|
$response
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class Update extends Action
|
||||||
|
|
||||||
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
|
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
|
||||||
{
|
{
|
||||||
$decodedDefault = \is_string($default) ? \json_decode($default, true) : $default;
|
$default = \is_string($default) ? \json_decode($default, true) : $default;
|
||||||
|
|
||||||
$attribute = $this->updateAttribute(
|
$attribute = $this->updateAttribute(
|
||||||
databaseId: $databaseId,
|
databaseId: $databaseId,
|
||||||
|
|
@ -83,7 +83,7 @@ class Update extends Action
|
||||||
dbForProject: $dbForProject,
|
dbForProject: $dbForProject,
|
||||||
queueForEvents: $queueForEvents,
|
queueForEvents: $queueForEvents,
|
||||||
type: Database::VAR_POINT,
|
type: Database::VAR_POINT,
|
||||||
default: $decodedDefault,
|
default: $default,
|
||||||
required: $required,
|
required: $required,
|
||||||
newKey: $newKey
|
newKey: $newKey
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ class Create extends Action
|
||||||
|
|
||||||
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
|
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
|
||||||
{
|
{
|
||||||
$decodedDefault = \is_string($default) ? \json_decode($default, true) : $default;
|
$default = \is_string($default) ? \json_decode($default, true) : $default;
|
||||||
|
|
||||||
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
|
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'type' => Database::VAR_POLYGON,
|
'type' => Database::VAR_POLYGON,
|
||||||
'required' => $required,
|
'required' => $required,
|
||||||
'default' => $decodedDefault,
|
'default' => $default,
|
||||||
]), $response, $dbForProject, $queueForDatabase, $queueForEvents);
|
]), $response, $dbForProject, $queueForDatabase, $queueForEvents);
|
||||||
|
|
||||||
$response
|
$response
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class Update extends Action
|
||||||
|
|
||||||
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
|
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
|
||||||
{
|
{
|
||||||
$decodedDefault = \is_string($default) ? \json_decode($default, true) : $default;
|
$default = \is_string($default) ? \json_decode($default, true) : $default;
|
||||||
|
|
||||||
$attribute = $this->updateAttribute(
|
$attribute = $this->updateAttribute(
|
||||||
databaseId: $databaseId,
|
databaseId: $databaseId,
|
||||||
|
|
@ -82,7 +82,7 @@ class Update extends Action
|
||||||
dbForProject: $dbForProject,
|
dbForProject: $dbForProject,
|
||||||
queueForEvents: $queueForEvents,
|
queueForEvents: $queueForEvents,
|
||||||
type: Database::VAR_POLYGON,
|
type: Database::VAR_POLYGON,
|
||||||
default: $decodedDefault,
|
default: $default,
|
||||||
required: $required,
|
required: $required,
|
||||||
newKey: $newKey
|
newKey: $newKey
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue