fix(blog): align soft delete with deleted_at
TaxBaik CI/CD / build-and-deploy (push) Failing after 2m44s
TaxBaik CI/CD / build-and-deploy (push) Failing after 2m44s
This commit is contained in:
@@ -12,7 +12,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
|||||||
return await conn.QueryFirstOrDefaultAsync<BlogPost>(
|
return await conn.QueryFirstOrDefaultAsync<BlogPost>(
|
||||||
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
||||||
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
||||||
bp.is_published, bp.created_at, bp.updated_at, c.name AS category_name
|
bp.is_published, bp.created_at, bp.updated_at, bp.deleted_at, c.name AS category_name
|
||||||
FROM blog_posts bp
|
FROM blog_posts bp
|
||||||
LEFT JOIN categories c ON bp.category_id = c.id
|
LEFT JOIN categories c ON bp.category_id = c.id
|
||||||
WHERE bp.id = @Id AND bp.deleted_at IS NULL",
|
WHERE bp.id = @Id AND bp.deleted_at IS NULL",
|
||||||
@@ -25,7 +25,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
|||||||
return await conn.QueryFirstOrDefaultAsync<BlogPost>(
|
return await conn.QueryFirstOrDefaultAsync<BlogPost>(
|
||||||
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
||||||
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
||||||
bp.is_published, bp.created_at, bp.updated_at, c.name AS category_name
|
bp.is_published, bp.created_at, bp.updated_at, bp.deleted_at, c.name AS category_name
|
||||||
FROM blog_posts bp
|
FROM blog_posts bp
|
||||||
LEFT JOIN categories c ON bp.category_id = c.id
|
LEFT JOIN categories c ON bp.category_id = c.id
|
||||||
WHERE bp.slug = @Slug AND bp.is_published = TRUE AND bp.deleted_at IS NULL",
|
WHERE bp.slug = @Slug AND bp.is_published = TRUE AND bp.deleted_at IS NULL",
|
||||||
@@ -41,7 +41,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
|||||||
using var reader = await conn.QueryMultipleAsync(
|
using var reader = await conn.QueryMultipleAsync(
|
||||||
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
||||||
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
||||||
bp.is_published, bp.created_at, bp.updated_at, c.name AS category_name
|
bp.is_published, bp.created_at, bp.updated_at, bp.deleted_at, c.name AS category_name
|
||||||
FROM blog_posts bp
|
FROM blog_posts bp
|
||||||
LEFT JOIN categories c ON bp.category_id = c.id
|
LEFT JOIN categories c ON bp.category_id = c.id
|
||||||
WHERE bp.is_published = TRUE AND bp.deleted_at IS NULL AND (@CategoryId::int IS NULL OR bp.category_id = @CategoryId)
|
WHERE bp.is_published = TRUE AND bp.deleted_at IS NULL AND (@CategoryId::int IS NULL OR bp.category_id = @CategoryId)
|
||||||
@@ -64,7 +64,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
|||||||
return await conn.QueryAsync<BlogPost>(
|
return await conn.QueryAsync<BlogPost>(
|
||||||
@"SELECT bp.id, bp.title, bp.slug, bp.category_id, bp.tags,
|
@"SELECT bp.id, bp.title, bp.slug, bp.category_id, bp.tags,
|
||||||
bp.published_at, bp.view_count, bp.seo_description, bp.thumbnail_url,
|
bp.published_at, bp.view_count, bp.seo_description, bp.thumbnail_url,
|
||||||
bp.is_published, bp.created_at, bp.updated_at, c.name AS category_name
|
bp.is_published, bp.created_at, bp.updated_at, bp.deleted_at, c.name AS category_name
|
||||||
FROM blog_posts bp
|
FROM blog_posts bp
|
||||||
LEFT JOIN categories c ON bp.category_id = c.id
|
LEFT JOIN categories c ON bp.category_id = c.id
|
||||||
WHERE bp.is_published = TRUE AND bp.deleted_at IS NULL AND c.slug = @CategorySlug
|
WHERE bp.is_published = TRUE AND bp.deleted_at IS NULL AND c.slug = @CategorySlug
|
||||||
@@ -95,7 +95,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
|||||||
using var reader = await conn.QueryMultipleAsync(
|
using var reader = await conn.QueryMultipleAsync(
|
||||||
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
@"SELECT bp.id, bp.title, bp.content, bp.slug, bp.category_id, bp.tags, bp.author_id,
|
||||||
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
bp.published_at, bp.view_count, bp.seo_title, bp.seo_description, bp.thumbnail_url,
|
||||||
bp.is_published, bp.created_at, bp.updated_at, c.name AS category_name
|
bp.is_published, bp.created_at, bp.updated_at, bp.deleted_at, c.name AS category_name
|
||||||
FROM blog_posts bp
|
FROM blog_posts bp
|
||||||
LEFT JOIN categories c ON bp.category_id = c.id
|
LEFT JOIN categories c ON bp.category_id = c.id
|
||||||
WHERE bp.deleted_at IS NULL
|
WHERE bp.deleted_at IS NULL
|
||||||
|
|||||||
@@ -116,16 +116,6 @@
|
|||||||
Navigation.LocationChanged += OnLocationChanged;
|
Navigation.LocationChanged += OnLocationChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
||||||
{
|
|
||||||
if (!firstRender)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var viewportWidth = await JS.InvokeAsync<int>("taxbaikAdminSession.getViewportWidth");
|
|
||||||
drawerOpen = viewportWidth >= 960;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnLocationChanged(object? sender, LocationChangedEventArgs args)
|
private void OnLocationChanged(object? sender, LocationChangedEventArgs args)
|
||||||
{
|
{
|
||||||
_ = InvokeAsync(() => JS.InvokeVoidAsync("taxbaikAdminSession.hideLoading"));
|
_ = InvokeAsync(() => JS.InvokeVoidAsync("taxbaikAdminSession.hideLoading"));
|
||||||
|
|||||||
@@ -330,24 +330,15 @@ else
|
|||||||
<p class="text-muted">상담 전 궁금하신 사항을 먼저 확인해 보세요</p>
|
<p class="text-muted">상담 전 궁금하신 사항을 먼저 확인해 보세요</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="accordion faq-accordion" id="faqAccordion">
|
<div class="faq-accordion">
|
||||||
@for (int i = 0; i < Model.ActiveFaqs.Count; i++)
|
@foreach (var faqItem in Model.ActiveFaqs)
|
||||||
{
|
{
|
||||||
var faqItem = Model.ActiveFaqs[i];
|
<details class="faq-item">
|
||||||
var collapseId = $"faq-{faqItem.Id}";
|
<summary class="faq-question">@faqItem.Question</summary>
|
||||||
<div class="accordion-item faq-item">
|
<div class="faq-answer">
|
||||||
<h3 class="accordion-header">
|
@faqItem.Answer
|
||||||
<button class="accordion-button collapsed faq-question" type="button"
|
|
||||||
data-bs-toggle="collapse" data-bs-target="#@collapseId">
|
|
||||||
@faqItem.Question
|
|
||||||
</button>
|
|
||||||
</h3>
|
|
||||||
<div id="@collapseId" class="accordion-collapse collapse" data-bs-parent="#faqAccordion">
|
|
||||||
<div class="accordion-body faq-answer">
|
|
||||||
@faqItem.Answer
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</details>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -682,21 +682,22 @@ img {
|
|||||||
border-radius: var(--radius-md) !important;
|
border-radius: var(--radius-md) !important;
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background: white;
|
||||||
}
|
}
|
||||||
.faq-question {
|
.faq-question {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
background: white;
|
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
padding: 1.1rem 1.5rem;
|
padding: 1.1rem 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: none;
|
||||||
}
|
}
|
||||||
.faq-question:not(.collapsed) {
|
.faq-question::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.faq-item[open] .faq-question {
|
||||||
color: var(--color-secondary);
|
color: var(--color-secondary);
|
||||||
background: white;
|
border-bottom: 1px solid var(--color-border);
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
.faq-question::after {
|
|
||||||
filter: none;
|
|
||||||
}
|
}
|
||||||
.faq-question:focus {
|
.faq-question:focus {
|
||||||
box-shadow: 0 0 0 3px rgba(200, 157, 110, 0.2);
|
box-shadow: 0 0 0 3px rgba(200, 157, 110, 0.2);
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE blog_posts
|
||||||
|
ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMPTZ;
|
||||||
|
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_blog_posts_deleted_at
|
||||||
|
ON blog_posts (deleted_at)
|
||||||
|
WHERE deleted_at IS NOT NULL;
|
||||||
Reference in New Issue
Block a user