Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Journal Entries Created with API not showing in web UI #7534

Open
3 tasks done
JeremyBolster opened this issue Feb 2, 2025 · 0 comments
Open
3 tasks done

Journal Entries Created with API not showing in web UI #7534

JeremyBolster opened this issue Feb 2, 2025 · 0 comments
Labels

Comments

@JeremyBolster
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • I agree to follow Monica's Code of Conduct.

Bug description

Journal Entries Created with API not showing in web UI

Steps to reproduce

  1. curl -X POST https://monica.example.com/api/journal -H $AuthBearerToken --data '{"title": "test", "post": "test"}' --header "Content-Type: application/json"
  2. curl -X GET https://monica.example.com/api/journal/$id -H $AuthBearerToken # This returns the data correctly
  3. go to https://monica.example.com/journal in a web browser
  4. The new entry does not show up.

Expected behavior

I expect the new Journal entry to show up in the web UI.

Environment

Your own self-hosted instance (monica v4)

Version of Monica

4.1.2

Installation method

Docker image

Web server

Apache

Database engine version

MariaDB

Additional info

The following SQL fixes the issue, although I did not look into the implications of editing the DB like this.

INSERT INTO journal_entries (account_id, date, journalable_id, journalable_type, created_at, updated_at)
SELECT 1, entries.created_at, entries.id, "App\\Models\\Journal\\Entry", entries.created_at, entries.updated_at
FROM entries
WHERE NOT EXISTS (
    SELECT 1 -- I am a single user instance, so I have user id of `1`, substitute for yours
    FROM journal_entries
    WHERE journal_entries.journalable_id = entries.id
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant