PlanB-Network / bitcoin-learning-management-system

PlanB Network
20 stars 17 forks source link

fix(blogs): fixed sync function for blog tags #711

Closed Flashmaxi closed 3 weeks ago

trigger67 commented 3 weeks ago

What is the issue you are fixing with this PR?

Flashmaxi commented 3 weeks ago

@trigger67 well when I wrote the function tags were not updating correctly as stated, so now when you sync with this update of function all tags are updated correctly and there are not extra (old) tags there. Basically this is the fix for issue on backlog #707

trigger67 commented 3 weeks ago

I updated one tag in the repo, and instead of updating it in my DB,, the sync kept it and added a new one, now there are three tags instead of two.

Also you added insertion of tags in the localized files (in createUpdateBlogs), but they are already inserted in the createProcessMainFile as tags are the same for all languages.

Please read the code, understand how the sync process works for blogs, and rework this PR.

trigger67 commented 3 weeks ago

I did run this locally, after the sync I have zero tags remaining in my DB, everything is removed.

Also again, the same remark as before :

Also you added insertion of tags in the localized files (in createUpdateBlogs), but they are already inserted in the createProcessMainFile as tags are the same for all languages.

trigger67 commented 3 weeks ago

You added the conditions that was removed in a previous commit.

if (file.kind === 'renamed') does never happen, this has te be removed, as it was before

Also the check of if (['added', 'modified', 'renamed'].includes(file.kind)) { has to be removed.

trigger67 commented 3 weeks ago

The code does not execute ERROR: syntax error at or near "$8" at character 272

trigger67 commented 3 weeks ago

Also I prefer the old version, without the new variable newTags, with the toLowerCase directly in the insert statement