Skip to content

Commit 92091e9

Browse files
committed
Merge branch 'feat/byok-frontend-ui'
2 parents 4da3779 + b0c68b9 commit 92091e9

8 files changed

Lines changed: 11 additions & 13 deletions

File tree

‎apps/dashboard-api/src/controllers/project.controller.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,7 @@ module.exports.getSingleProject = async (req, res) => {
522522
await setProjectById(req.params.projectId, projectObj);
523523
}
524524

525-
res.json({
526-
success: true,
527-
data: sanitizeProjectResponse(projectObj),
528-
message: ""
529-
});
525+
res.json(sanitizeProjectResponse(projectObj));
530526
} catch (err) {
531527
if (err instanceof AppError) {
532528
return res.status(err.statusCode).json({

‎apps/web-dashboard/src/components/Layout/Header.jsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ function Header({ onToggleSidebar, showToggle = true, isSidebarCollapsed = false
2626
}
2727
api.get(`/api/projects/${projectId}`)
2828
.then(res => {
29-
if (isMounted) setProjectName(res.data.name);
29+
const projectData = res.data?.data || res.data;
30+
if (isMounted && projectData) setProjectName(projectData.name || '');
3031
})
3132
.catch(err => console.error("Failed to fetch project name for header:", err));
3233
return () => { isMounted = false; };

‎apps/web-dashboard/src/pages/Database.jsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export default function Database() {
6363
const fetchProject = async () => {
6464
try {
6565
const res = await api.get(`/api/projects/${projectId}`);
66-
const withRlsDefaults = (res.data.collections || []).map(c => ({
66+
const projectData = res.data?.data || res.data;
67+
const withRlsDefaults = (projectData?.collections || []).map(c => ({
6768
...c,
6869
rls: {
6970
enabled: typeof c.rls?.enabled === 'boolean' ? c.rls.enabled : false,
@@ -73,7 +74,7 @@ export default function Database() {
7374
}
7475
}));
7576
if (isMounted) {
76-
setProject(res.data);
77+
setProject(projectData);
7778
setCollections(withRlsDefaults);
7879
const queryCol = searchParams.get("collection");
7980
if (queryCol) {

‎apps/web-dashboard/src/pages/MailPlatform.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function MailPlatform() {
6262
api.get(`/api/projects/${projectId}`),
6363
api.get(`/api/projects/${projectId}/mail/logs`)
6464
]);
65-
setProject(projRes.data);
65+
setProject(projRes.data?.data || projRes.data);
6666
if (logsRes.data?.success) {
6767
setLogs(logsRes.data.data.logs || []);
6868
}

‎apps/web-dashboard/src/pages/ProjectDetails.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function ProjectDetails() {
4444
api.get(`/api/projects/${projectId}/analytics`)
4545
]);
4646
if (isMounted) {
47-
setProject(projectRes.data);
47+
setProject(projectRes.data?.data || projectRes.data);
4848
setAnalytics(analyticsRes.data.success ? analyticsRes.data.data : analyticsRes.data);
4949
}
5050
} catch (err){

‎apps/web-dashboard/src/pages/ProjectSettings.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function ProjectSettings() {
5454
const fetchProject = async () => {
5555
try {
5656
const res = await api.get(`/api/projects/${projectId}`);
57-
const projectData = res.data;
57+
const projectData = res.data?.data || res.data;
5858
const myMember = projectData?.members?.find(m => {
5959
const memberId = typeof m.user === 'object' ? m.user?._id : m.user;
6060
return memberId?.toString() === user?._id?.toString() || m.email === user?.email;

‎apps/web-dashboard/src/pages/Storage.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function Storage() {
2424
api.get(`/api/projects/${projectId}`),
2525
api.get(`/api/projects/${projectId}/storage/files`)
2626
]);
27-
setProject(projRes.data);
27+
setProject(projRes.data?.data || projRes.data);
2828
setFiles(filesRes.data);
2929
} catch {
3030
toast.error("Failed to load files");

‎apps/web-dashboard/src/pages/Webhooks.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function Webhooks() {
6565
api.get(`/api/projects/${projectId}`),
6666
api.get(`/api/projects/${projectId}/webhooks`)
6767
]);
68-
setProject(projRes.data);
68+
setProject(projRes.data?.data || projRes.data);
6969
setWebhooks(webhooksRes.data.data || []);
7070
} catch (err) {
7171
console.error(err);

0 commit comments

Comments
 (0)