So i want to get all commPlans from IDs inside comms but for some reason i only get one object(which is the first ID in comms). Here is my code:
comms := models.GetComms(CommID)
if comms == nil {
componentsJson.WriteError(ctx, componentsError.ERROR_PARAMETERS_INVALID)
return
}
var commPlans []models.CommPlan
for _, comm := range comms {
commPlans = models.GetCommPlans(comm.CommPlanID)
}
if commPlans == nil {
componentsJson.WriteError(ctx, componentsError.ERROR_PARAMETERS_INVALID)
return
}