adding changes to adhere to timescale db changes
This commit is contained in:
1 parent
41fa2717a9
commit
c7d93311ce
1 file changed
+7
-3
@@ -26,6 +26,7 @@ interface StatusPageRow {
|
|||||||
show_uptime_percentage: boolean;
|
show_uptime_percentage: boolean;
|
||||||
show_admin_login_link: boolean;
|
show_admin_login_link: boolean;
|
||||||
show_infrastructure: boolean;
|
show_infrastructure: boolean;
|
||||||
|
show_page_speed: boolean;
|
||||||
custom_css: string | null;
|
custom_css: string | null;
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
updated_at: Date;
|
updated_at: Date;
|
||||||
@@ -33,7 +34,7 @@ interface StatusPageRow {
|
|||||||
|
|
||||||
const COLUMNS = `id, user_id, team_id, types, company_name, url, timezone, color,
|
const COLUMNS = `id, user_id, team_id, types, company_name, url, timezone, color,
|
||||||
logo_data, logo_content_type, is_published, show_charts, show_uptime_percentage,
|
logo_data, logo_content_type, is_published, show_charts, show_uptime_percentage,
|
||||||
show_admin_login_link, show_infrastructure, custom_css, created_at, updated_at`;
|
show_admin_login_link, show_infrastructure, show_page_speed, custom_css, created_at, updated_at`;
|
||||||
|
|
||||||
export class TimescaleStatusPagesRepository implements IStatusPagesRepository {
|
export class TimescaleStatusPagesRepository implements IStatusPagesRepository {
|
||||||
constructor(private pool: Pool) {}
|
constructor(private pool: Pool) {}
|
||||||
@@ -42,8 +43,8 @@ export class TimescaleStatusPagesRepository implements IStatusPagesRepository {
|
|||||||
const result = await this.pool.query<StatusPageRow>(
|
const result = await this.pool.query<StatusPageRow>(
|
||||||
`INSERT INTO status_pages (user_id, team_id, types, company_name, url, timezone, color,
|
`INSERT INTO status_pages (user_id, team_id, types, company_name, url, timezone, color,
|
||||||
logo_data, logo_content_type, is_published, show_charts, show_uptime_percentage,
|
logo_data, logo_content_type, is_published, show_charts, show_uptime_percentage,
|
||||||
show_admin_login_link, show_infrastructure, custom_css)
|
show_admin_login_link, show_infrastructure, show_page_speed, custom_css)
|
||||||
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)
|
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16)
|
||||||
RETURNING ${COLUMNS}`,
|
RETURNING ${COLUMNS}`,
|
||||||
[
|
[
|
||||||
userId,
|
userId,
|
||||||
@@ -60,6 +61,7 @@ export class TimescaleStatusPagesRepository implements IStatusPagesRepository {
|
|||||||
data.showUptimePercentage ?? false,
|
data.showUptimePercentage ?? false,
|
||||||
data.showAdminLoginLink ?? false,
|
data.showAdminLoginLink ?? false,
|
||||||
data.showInfrastructure ?? false,
|
data.showInfrastructure ?? false,
|
||||||
|
data.showPageSpeed ?? false,
|
||||||
data.customCSS ?? null,
|
data.customCSS ?? null,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@@ -128,6 +130,7 @@ export class TimescaleStatusPagesRepository implements IStatusPagesRepository {
|
|||||||
["showUptimePercentage", "show_uptime_percentage"],
|
["showUptimePercentage", "show_uptime_percentage"],
|
||||||
["showAdminLoginLink", "show_admin_login_link"],
|
["showAdminLoginLink", "show_admin_login_link"],
|
||||||
["showInfrastructure", "show_infrastructure"],
|
["showInfrastructure", "show_infrastructure"],
|
||||||
|
["showPageSpeed", "show_page_speed"],
|
||||||
["customCSS", "custom_css"],
|
["customCSS", "custom_css"],
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -252,6 +255,7 @@ export class TimescaleStatusPagesRepository implements IStatusPagesRepository {
|
|||||||
showUptimePercentage: row.show_uptime_percentage,
|
showUptimePercentage: row.show_uptime_percentage,
|
||||||
showAdminLoginLink: row.show_admin_login_link,
|
showAdminLoginLink: row.show_admin_login_link,
|
||||||
showInfrastructure: row.show_infrastructure,
|
showInfrastructure: row.show_infrastructure,
|
||||||
|
showPageSpeed: row.show_page_speed,
|
||||||
customCSS: row.custom_css ?? "",
|
customCSS: row.custom_css ?? "",
|
||||||
createdAt: row.created_at.toISOString(),
|
createdAt: row.created_at.toISOString(),
|
||||||
updatedAt: row.updated_at.toISOString(),
|
updatedAt: row.updated_at.toISOString(),
|
||||||
|
|||||||
Reference in new issue
Block a user