fix: update fixing articles

This commit is contained in:
hanif salafi 2025-10-13 00:11:22 +07:00
parent d8087681fb
commit ee61a0411c
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ func (_i *articlesRepository) GetAllPublishSchedule(clientId *uuid.UUID) (articl
func (_i *articlesRepository) FindOne(clientId *uuid.UUID, id uint) (articles *entity.Articles, err error) {
query := _i.DB.DB
if clientId != nil {
if clientId != nil && _i.Cfg.App.PrimaryClientKey != clientId.String() {
query = query.Where("client_id = ?", clientId)
}
if err := query.First(&articles, id).Error; err != nil {
@ -220,7 +220,7 @@ func (_i *articlesRepository) FindOne(clientId *uuid.UUID, id uint) (articles *e
func (_i *articlesRepository) FindByFilename(clientId *uuid.UUID, thumbnailName string) (articles *entity.Articles, err error) {
query := _i.DB.DB.Where("thumbnail_name = ?", thumbnailName)
if clientId != nil {
if clientId != nil && _i.Cfg.App.PrimaryClientKey != clientId.String() {
query = query.Where("client_id = ?", clientId)
}
if err := query.First(&articles).Error; err != nil {