diff --git a/internal/indexer/refresh_headers.go b/internal/indexer/refresh_headers.go index 22ac17ad5..2aeae2019 100644 --- a/internal/indexer/refresh_headers.go +++ b/internal/indexer/refresh_headers.go @@ -210,9 +210,16 @@ func refreshDocumentHeader( os.Exit(1) } + // If the document was created through Hermes and has a status of "WIP", it + // is a document draft. + isDraft := false + if doc.AppCreated && doc.Status == "WIP" { + isDraft = true + } + // Replace document header. if err := doc.ReplaceHeader( - idx.BaseURL, true, idx.GoogleWorkspaceService); err != nil { + idx.BaseURL, isDraft, idx.GoogleWorkspaceService); err != nil { log.Error("error replacing document header", "error", err, "google_file_id", file.Id,