Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

120
Vistas
Type Promose<Response> is missing

I am getting this error and I am not sure why. In my dialog class I have the Promse and the fail logic. I am getting this build error any help would be great.

Severity Code Description File Project Line Suppression State Error TS2740 (TS) Type 'Promise' is missing the following properties from type 'JQueryPromise': state, always, done, fail, and 2 more.

 var responsePromse = this.agentManager.getStyleGuideByAgentId(this.model.Id);

        responsePromse.then((response) => {
            this.styleguideNote.AgentType = response.responseObject.Name;
        }).fail(() => {
                this.relatedTemplates.loadingState = 0;
        });

AgentManager

getStyleGuideByAgentId(Id: number): JQueryPromise<any> {
    var request = this.agentsService.getStyleGuideByAgentId(Id);
    console.log(request);
    return request;
}  

AgentService

getStyleGuideByAgentId(Id: number) {
    var x = this.http.post(this.apiUrls.GetStyleGuideNotes, JSON.stringify(Id), { headers: ServiceBase.headers }).toPromise();
    return x;
}

Conroller

 [HttpPost]
        public IHttpActionResult GetStyleGuideNoteById(long agentId)
        {            
            var dbResult = StyleGuideNotesDataService.GetStyleGuideNoteById(agentId);

            var styleguideNote = dbResult
                .Select(x=>  new 
                {
                    Section =x.Section,
                    AgentType = x.AgentType,
                    Status = x.Status.Name
                })
                .Distinct()
                .ToList();

            return Ok(styleguideNote);
        }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

TS Error message like this format Type 'A' is missing following properties from type 'B' means that, you typed 'B' explicitly to a value, but type of the value is actually 'A'.

so, You typed something explicitly as JQueryPromise, but that thing was actually Promise.

I think this code makes error.

getStyleGuideByAgentId(Id: number): JQueryPromise<any> {
    var request = this.agentsService.getStyleGuideByAgentId(Id);
    console.log(request);
    return request;
}

I'm not sure but getStyleGuideByAgentId actually returns standard Promise, not JqueryPromise due to toPromise()

so, changing code like this might be solve your problem.

async getStyleGuideByAgentId(Id: number): Promise<any> {
    var request = await this.agentsService.getStyleGuideByAgentId(Id);
    console.log(request);
    return request;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda