mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 15:17:15 +02:00
♻️ Refactor field name
This commit is contained in:
parent
b464181213
commit
d9aa94025a
3 changed files with 8 additions and 4 deletions
|
@ -96,7 +96,7 @@
|
||||||
(retrieve-all-projects conn profile-id)))
|
(retrieve-all-projects conn profile-id)))
|
||||||
|
|
||||||
(def sql:all-projects
|
(def sql:all-projects
|
||||||
"select p1.*, t.name as team_name, t.is_default as default_team
|
"select p1.*, t.name as team_name, t.is_default as is_default_team
|
||||||
from project as p1
|
from project as p1
|
||||||
inner join team as t
|
inner join team as t
|
||||||
on t.id = p1.team_id
|
on t.id = p1.team_id
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
tpr.is_admin = true))
|
tpr.is_admin = true))
|
||||||
and p1.deleted_at is null
|
and p1.deleted_at is null
|
||||||
union
|
union
|
||||||
select p2.*, t.name as team_name, t.is_default as default_team
|
select p2.*, t.name as team_name, t.is_default as is_default_team
|
||||||
from project as p2
|
from project as p2
|
||||||
inner join team as t
|
inner join team as t
|
||||||
on t.id = p2.team_id
|
on t.id = p2.team_id
|
||||||
|
|
|
@ -61,8 +61,12 @@
|
||||||
(t/is (= 2 (count result)))
|
(t/is (= 2 (count result)))
|
||||||
(t/is (not= project-id (get-in result [0 :id])))
|
(t/is (not= project-id (get-in result [0 :id])))
|
||||||
(t/is (= "Drafts" (get-in result [0 :name])))
|
(t/is (= "Drafts" (get-in result [0 :name])))
|
||||||
|
(t/is (= "Default" (get-in result [0 :team-name])))
|
||||||
|
(t/is (= true (get-in result [0 :is-default-team])))
|
||||||
(t/is project-id (get-in result [1 :id]))
|
(t/is project-id (get-in result [1 :id]))
|
||||||
(t/is (= "test project" (get-in result [1 :name])))))
|
(t/is (= "test project" (get-in result [1 :name])))
|
||||||
|
(t/is (= "team1" (get-in result [1 :team-name])))
|
||||||
|
(t/is (= false (get-in result [1 :is-default-team])))))
|
||||||
|
|
||||||
;; rename project
|
;; rename project
|
||||||
(let [data {::th/type :rename-project
|
(let [data {::th/type :rename-project
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
#(if (nil? %)
|
#(if (nil? %)
|
||||||
{:id (:team-id project)
|
{:id (:team-id project)
|
||||||
:name (:team-name project)
|
:name (:team-name project)
|
||||||
:is-default (:default-team project)
|
:is-default (:is-default-team project)
|
||||||
:projects [project]}
|
:projects [project]}
|
||||||
(update % :projects conj project))))
|
(update % :projects conj project))))
|
||||||
{}
|
{}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue