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>(
|
||||
@"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.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
|
||||
LEFT JOIN categories c ON bp.category_id = c.id
|
||||
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>(
|
||||
@"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.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
|
||||
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",
|
||||
@@ -41,7 +41,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
||||
using var reader = await conn.QueryMultipleAsync(
|
||||
@"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.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
|
||||
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)
|
||||
@@ -64,7 +64,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
||||
return await conn.QueryAsync<BlogPost>(
|
||||
@"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.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
|
||||
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
|
||||
@@ -95,7 +95,7 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
||||
using var reader = await conn.QueryMultipleAsync(
|
||||
@"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.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
|
||||
LEFT JOIN categories c ON bp.category_id = c.id
|
||||
WHERE bp.deleted_at IS NULL
|
||||
|
||||
@@ -116,16 +116,6 @@
|
||||
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)
|
||||
{
|
||||
_ = InvokeAsync(() => JS.InvokeVoidAsync("taxbaikAdminSession.hideLoading"));
|
||||
|
||||
@@ -330,24 +330,15 @@ else
|
||||
<p class="text-muted">상담 전 궁금하신 사항을 먼저 확인해 보세요</p>
|
||||
</div>
|
||||
|
||||
<div class="accordion faq-accordion" id="faqAccordion">
|
||||
@for (int i = 0; i < Model.ActiveFaqs.Count; i++)
|
||||
<div class="faq-accordion">
|
||||
@foreach (var faqItem in Model.ActiveFaqs)
|
||||
{
|
||||
var faqItem = Model.ActiveFaqs[i];
|
||||
var collapseId = $"faq-{faqItem.Id}";
|
||||
<div class="accordion-item faq-item">
|
||||
<h3 class="accordion-header">
|
||||
<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>
|
||||
<details class="faq-item">
|
||||
<summary class="faq-question">@faqItem.Question</summary>
|
||||
<div class="faq-answer">
|
||||
@faqItem.Answer
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -682,21 +682,22 @@ img {
|
||||
border-radius: var(--radius-md) !important;
|
||||
margin-bottom: 0.75rem;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
}
|
||||
.faq-question {
|
||||
font-weight: 700;
|
||||
color: var(--color-text);
|
||||
background: white;
|
||||
font-size: 1rem;
|
||||
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);
|
||||
background: white;
|
||||
box-shadow: none;
|
||||
}
|
||||
.faq-question::after {
|
||||
filter: none;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
.faq-question:focus {
|
||||
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