0

I'm dealing with a Next Typescript project. I'm building a form with formik, slate framework to send a form with rich text to server. The problem is with the old data, it was already stored in database as plain text and the new one will be stored as rich text. So, when I receive all data from server, the errors happen when I try to show the data. I need to separate which is the old data with plain text and which is the new with rich text and then use the approciate method to show the data. Please help me and forgive for my bad english.

I tried to slice the string of the response data. If it contain word like "bold, italic,...." so that was rich text but it won't work.

  • Have you tried storing the type of the data in your database? That way you won’t have to manually check if it is rich text – koolskateguy89 Jan 05 '23 at 15:26
  • After a conversation, now the backend dev is working with the database so that fe dev no need to deal with it anymore. Tks anyway pal. I think that is easier than trying to solve different data responses. – Just NQuang Jan 07 '23 at 02:02

0 Answers0