diff --git a/backend/src/app/rpc/queries/projects.clj b/backend/src/app/rpc/queries/projects.clj index a69c5ffc85..be4697d44e 100644 --- a/backend/src/app/rpc/queries/projects.clj +++ b/backend/src/app/rpc/queries/projects.clj @@ -96,7 +96,7 @@ (retrieve-all-projects conn profile-id))) (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 inner join team as t on t.id = p1.team_id @@ -108,7 +108,7 @@ tpr.is_admin = true)) and p1.deleted_at is null 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 inner join team as t on t.id = p2.team_id diff --git a/backend/tests/app/tests/test_services_projects.clj b/backend/tests/app/tests/test_services_projects.clj index 91148377d8..0d4fabf8d8 100644 --- a/backend/tests/app/tests/test_services_projects.clj +++ b/backend/tests/app/tests/test_services_projects.clj @@ -61,8 +61,12 @@ (t/is (= 2 (count result))) (t/is (not= project-id (get-in result [0 :id]))) (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 (= "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 (let [data {::th/type :rename-project diff --git a/frontend/src/app/main/ui/dashboard/file_menu.cljs b/frontend/src/app/main/ui/dashboard/file_menu.cljs index bb6c721960..fb36ab5525 100644 --- a/frontend/src/app/main/ui/dashboard/file_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/file_menu.cljs @@ -152,7 +152,7 @@ #(if (nil? %) {:id (:team-id project) :name (:team-name project) - :is-default (:default-team project) + :is-default (:is-default-team project) :projects [project]} (update % :projects conj project)))) {}