feat: disable custom script for trial users (#371)
* feat: disable custom script for trial users * fix: logic error for trial users --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -40,6 +40,7 @@ class FormResource extends JsonResource
|
||||
|
||||
return array_merge(parent::toArray($request), $ownerData, [
|
||||
'is_pro' => $this->workspaceIsPro(),
|
||||
'is_trialing' => $this->workspaceIsTrialing(),
|
||||
'workspace_id' => $this->workspace_id,
|
||||
'workspace' => new WorkspaceResource($this->getWorkspace()),
|
||||
'is_closed' => $this->is_closed,
|
||||
@@ -92,6 +93,11 @@ class FormResource extends JsonResource
|
||||
return $this->extra?->workspaceIsPro ?? $this->getWorkspace()->is_pro ?? $this->is_pro;
|
||||
}
|
||||
|
||||
private function workspaceIsTrialing()
|
||||
{
|
||||
return $this->getWorkspace()->is_trialing;
|
||||
}
|
||||
|
||||
private function userIsFormOwner()
|
||||
{
|
||||
return $this->extra?->userIsOwner ??
|
||||
|
||||
Reference in New Issue
Block a user