File tree Expand file tree Collapse file tree 6 files changed +30
-10
lines changed
Expand file tree Collapse file tree 6 files changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -134,16 +134,20 @@ export const updateCall = async (callData: UpdateCallRequest) => {
134134 const dispatchEntries : string [ ] = [ ] ;
135135
136136 if ( callData . dispatchUsers ) {
137- dispatchEntries . push ( ...callData . dispatchUsers . map ( ( user ) => `U:${ user } ` ) ) ;
137+ //dispatchEntries.push(...callData.dispatchUsers.map((user) => `U:${user}`));
138+ dispatchEntries . push ( ...callData . dispatchUsers ) ;
138139 }
139140 if ( callData . dispatchGroups ) {
140- dispatchEntries . push ( ...callData . dispatchGroups . map ( ( group ) => `G:${ group } ` ) ) ;
141+ //dispatchEntries.push(...callData.dispatchGroups.map((group) => `G:${group}`));
142+ dispatchEntries . push ( ...callData . dispatchGroups ) ;
141143 }
142144 if ( callData . dispatchRoles ) {
143- dispatchEntries . push ( ...callData . dispatchRoles . map ( ( role ) => `R:${ role } ` ) ) ;
145+ //dispatchEntries.push(...callData.dispatchRoles.map((role) => `R:${role}`));
146+ dispatchEntries . push ( ...callData . dispatchRoles ) ;
144147 }
145148 if ( callData . dispatchUnits ) {
146- dispatchEntries . push ( ...callData . dispatchUnits . map ( ( unit ) => `U:${ unit } ` ) ) ;
149+ //dispatchEntries.push(...callData.dispatchUnits.map((unit) => `U:${unit}`));
150+ dispatchEntries . push ( ...callData . dispatchUnits ) ;
147151 }
148152
149153 dispatchList = dispatchEntries . join ( '|' ) ;
Original file line number Diff line number Diff line change @@ -182,17 +182,27 @@ export default function NewCall() {
182182 data . longitude = selectedLocation . longitude ;
183183 }
184184
185- // TODO: Implement the API call to create a new call
186- console . log ( 'Creating new call with data:' , data ) ;
187-
185+ // Validate priority and type before proceeding
188186 const priority = callPriorities . find ( ( p ) => p . Name === data . priority ) ;
189187 const type = callTypes . find ( ( t ) => t . Name === data . type ) ;
190188
189+ if ( ! priority ) {
190+ toast . error ( t ( 'calls.invalid_priority' ) ) ;
191+ return ;
192+ }
193+
194+ if ( ! type ) {
195+ toast . error ( t ( 'calls.invalid_type' ) ) ;
196+ return ;
197+ }
198+
199+ console . log ( 'Creating new call with data:' , data ) ;
200+
191201 const response = await createCall ( {
192202 name : data . name ,
193203 nature : data . nature ,
194- priority : priority ? .Id || 0 ,
195- type : type ? .Id || '' ,
204+ priority : priority . Id ,
205+ type : type . Id ,
196206 note : data . note ,
197207 address : data . address ,
198208 latitude : data . latitude ,
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export default function Onboarding() {
122122 keyExtractor = { ( item ) => item . title }
123123 onScroll = { handleScroll }
124124 scrollEventThrottle = { 16 }
125- style = { { height : 400 } }
125+ className = "flex-1"
126126 />
127127 </ View >
128128
Original file line number Diff line number Diff line change 231231 },
232232 "geocoding_error" : " فشل البحث عن العنوان، يرجى المحاولة مرة أخرى" ,
233233 "groups" : " المجموعات" ,
234+ "invalid_priority" : " أولوية غير صحيحة محددة. يرجى اختيار أولوية صحيحة." ,
235+ "invalid_type" : " نوع غير صحيح محدد. يرجى اختيار نوع مكالمة صحيح." ,
234236 "loading" : " جاري تحميل المكالمات..." ,
235237 "loading_calls" : " جاري تحميل المكالمات..." ,
236238 "name" : " الاسم" ,
Original file line number Diff line number Diff line change 231231 },
232232 "geocoding_error" : " Failed to search for address, please try again" ,
233233 "groups" : " Groups" ,
234+ "invalid_priority" : " Invalid priority selected. Please select a valid priority." ,
235+ "invalid_type" : " Invalid type selected. Please select a valid call type." ,
234236 "loading" : " Loading calls..." ,
235237 "loading_calls" : " Loading calls..." ,
236238 "name" : " Name" ,
Original file line number Diff line number Diff line change 231231 },
232232 "geocoding_error" : " Error al buscar la dirección, por favor inténtelo de nuevo" ,
233233 "groups" : " Grupos" ,
234+ "invalid_priority" : " Prioridad inválida seleccionada. Por favor seleccione una prioridad válida." ,
235+ "invalid_type" : " Tipo inválido seleccionado. Por favor seleccione un tipo de llamada válido." ,
234236 "loading" : " Cargando llamadas..." ,
235237 "loading_calls" : " Cargando llamadas..." ,
236238 "name" : " Nombre" ,
You can’t perform that action at this time.
0 commit comments