Есть ли способ заменить {{session_id}} и {{skill_name}} в enum (share.tsx) на данные из API.
Ниже моя попытка:
Shared.tsx
----------
export enum NotificationMessage{
ASSIGNED_ALERT ="session {{session_id}} is now assigned to you.",
OFFERED_ALERT ="You have received session {{session_id}} on skill \"{{skill_name}}\"",
ASSIGN_CONFIRM_MESSAGE= "You have received session {{session_id}} on skill \"{{skill_name}}\"",
}
File B.tsx
-----------
import {NotificationMessage} from "../../shared";
// data from api
switch (data){
case A :
// Is there a way to replace {{session_id}}, and/or {{skill_name}} in enum (share.tsx) with data from api.
//My attempt to replace {{session_id}} with data.session_id
stringA = 'NotificationMessage.ASSIGNED_ALERT%s', data.session_id;
case B :
//My attempt to replace {{session_id}} and {{skill_name}} with data.session_id and data.skill_name
stringB = NotificationMessage.OFFERED_ALERT, data.session_id, data.skill_name;
case C :
//My attempt to replace {{session_id}} and {{skill_name}} with data.session_id and data.skill_name
stringC = NotificationMessage.ASSIGN_CONFIRM_MESSAGE, data.session_id, data.skill_name;
}