Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 16:43
    uniconstructor edited #4126
  • Jan 31 16:41
    uniconstructor edited #4126
  • Jan 31 16:41
    uniconstructor opened #4126
  • Jan 31 03:44
    dzungh0ang closed #4123
  • Jan 30 00:25
    techaks closed #4125
  • Jan 30 00:02
    techaks edited #4125
  • Jan 30 00:01
    techaks opened #4125
  • Jan 29 23:33
    jkpulido opened #4124
  • Jan 29 13:32
    nabdelgadir closed #4114
  • Jan 29 09:17

    bajtos on add-node10

    (compare)

  • Jan 29 07:13
    dzungh0ang opened #4123
  • Jan 29 04:25
    dhmlau closed #3881
  • Jan 28 13:14
    bajtos edited #4119
  • Jan 28 12:47
    bajtos labeled #4121
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos assigned #4118
  • Jan 25 19:50
    dhmlau closed #3906
  • Jan 25 19:13
    mschnee synchronize #4119
Darko Damljanović
@darko.damljanovic1_gitlab
@mamiller93 I have found what was wrong with the CORS. It was not Loopback at all.
Jyoti Chhetri
@jyoti-openair

HI, please anyone can tell me how I can do inner join

Ex: I have members table which is referencing the user

what I do it /members?filter={"include": ["user"]}

The problem here is its doing a left join, where as what I need is I need list of members who is also user . It also lists members who are not users. Is there a way to fix this ?

Hudison Souza
@Hudison
Hi, i need some advice. Me and my team will develop some applications that will communicate with other, this application will work basically like this:
A front-end application built with react that communicates with an API. The way that this API will work is: each one of our clients will have an individual database, their users will access our front-end app, this app will locate in a Database that contains the information of, what is their enterprise and will return some connection information for them. After this, each user will have the information of what is their enterprise, and our API will take this info and connect in the database and take the data. My questions are that I don't know the best way to do this (instantiate a datasource in each request and disconnect after || after a user of enterprise x connects, I will make this connection open while are active users on that enterprise || other solution)? And I'm wrong trying to use lb4 for this scenario?
Matthew Miller
@mamiller93
How does loopback handle mapping tables?
For example, patients and providers. Each patient could have multiple providers. Multiple patients could share providers. It’s not a strict one to many relationship. Our database has mapping tables to begin with.
I’m thinking we’ll still need to create belongsTo/hasX relations from the patient table to the mapping table and then again the mapping table to the provider table. And to get them, we’ll just have to go patientRepo.providermaps(patient.id).providers or something?
Richard Terungwa Kombol
@rkterungwa16
Hello everyone. How do you handle loggin in loopback4?
Nico Flaig
@nflaig
@rkterungwa16 We are using JWTs with access tokens and refresh tokens since we have a stateless microservice architecture which means there are no sessions
Richard Terungwa Kombol
@rkterungwa16
@nflaig . Thanks for the response. I meant logging using winston, bunyan or any other of the logging tools.
Nico Flaig
@nflaig
@rkterungwa16 sorry mb for some reason I read login. We have our own solution but it is based on winston.
Abhisek Pattnaik
@abhisekp

:question: :raising_hand: Is there any way to ignore linting while building the loopback project?

Jesus Maria Zabaleta Franco
@jesuszabaletafranco
Hello everyone
Darko Damljanović
@darko.damljanovic1_gitlab
Is there a way to link openapi specs from a separate file in order to keep controllers as clean as possible? I dont know what Im doing wrong, but it seams that even simple respose wont show as documented.
Ihar Salauyou
@igrslv
Hi, in loopback 4 what is the best and correct approach defining operational hooks? I have tried to add them in the model class but they are not triggered at all.
Mark Injerd
@pilot51
Does anyone have the mssql or email connectors working in lb4? The documentation isn't much help since it seems to be for lb3 (even though it's under lb4).
Richard Terungwa Kombol
@rkterungwa16
Hi @nflaig is there a way I can see how you implemented it?
Nico Flaig
@nflaig
Hi @rkterungwa16 it is nothing special tbh, you can log almost all errors in sequence.ts before reject(err). For additional logging just add it where you need it. I am pretty sure how we are doing it right now is not the best solution but it works. I am not to sure what exactly you are looking for, i hope this helped.
Richard Terungwa Kombol
@rkterungwa16
@nflaig this helps, thanks. However, it would be great if there was a standard loopback4 way of doing logging.
Radomir Djurdjevic
@Rasha-Dj
Hi everyone! Is there a way to define JSON API properties in snake case? It seems to be in camel case by default and I'm not finding any config option to change that. Help is appreciated!
Marco Strijker
@Octopixell
Hi all, am I correct in thinking you can only have one LB4 sequence? Not several?
Richard Terungwa Kombol
@rkterungwa16
Hello everyone. Is creating a validation component a bad idea? To expand further. I want to create a component that will handle validation for different api inputs. These different validation logic are going to be strategies. I don't know if this makes though. I am aware of validation for controller request body, but I need flexibility for more fine grained use cases.
Nico Flaig
@nflaig
Hi @rkterungwa16, in the loopback4 example shopping app they are using interceptors for input validation for example here. I have not implemented such a thing myself so I am not sure if this is the best appraoch. You might want to ask your question on stackoverflow using the #loobackjs and #loopback4 tags. It is more likely you get a good answer there.
@rkterungwa16 I just saw that interceptors can also be used for logging maybe that might be interesting for you as well https://loopback.io/doc/en/lb4/Interceptors.html
Richard Terungwa Kombol
@rkterungwa16
Thanks a lot @nflaig. I will take a look at it.
Pradeep Kumar Tippa
@pktippa
@bajtos what are design patterns that are involved in building LB4
Please
Darko Damljanović
@darko.damljanovic1_gitlab
Is there any way to make transaction for multiple database inserts? If there is possibility, how to implement it?
Darko Damljanović
@darko.damljanovic1_gitlab
@bajtos If we want to make transactions using multiple entities and their repositories, do we have to extend "DefaultTransactionalRepository" on every repository that is going to be a part of a transation?
Darko Damljanović
@darko.damljanovic1_gitlab
@mamiller93 Unfortunately no. Although, I was somewhat successful to separate OpenApi3 specs to another file using namespaces. I had to make RequestBody and ResponseObject separately and map them within "@operation()" decorator of a controller.
Rafaël Sarrechia
@Rsarrechia
is there any documentation on how to integrate facebook authentication into Loopback4 ? #loopback4 #loobackjs
Hassan Ahmed
@hasanzia1993_gitlab
Hi everyone, i have a question regarding embedsOne in loopback3 relationships. Consider the example here : https://loopback.io/doc/en/lb3/Embedded-models-and-relations.html
it has embedsMany with scope to include and it works fine but if it's embedsOne type then the include does not work. Any idea how to fix it or workaround?
"relations": {

    "people": {

      "type": "embedsMany",

      "model": "Link",

      "scope": {

        "include": "linked"

      }

    }

  }
Eduardo Mazzucchelli
@emazzu

hi people, how are you ??
what node component I need, for save the log in txt file, or database ??
loopback has something incluid for this ??

Regards
Eduardo

Edwin Zhao
@ezhao7

Hi all, I'm trying to make some POST and GET requests to Google API, but I keep getting an unhandled error " 500 TypeError: Cannot initialize connector "rest": Cannot read property 'root' of undefined

Is this the case where my JSON file is written incorrectly?

I'm also unclear on where Google AUTH key would go into the JSON file here
Edwin Zhao
@ezhao7
This error seems to appear when I have a parameter in a function call for any request. What would be the correct formatting?

controller.ts

  //ts-lint:disable-next-line: no-any
  async getDetails(): Promise<any> {
    return await this.apiService.getDetails('authToken');
  }

api.service.ts > interface
getDetails(apiKey: string): Promise<any>;

api.datasource.json

"operations": [{
    "template": {
      "method": "GET",
      "url": "https://mybusiness.googleapis.com/v4/accounts"
    },
    "functions": {
      "getDetails": ["authToken"]
    }
  }
This is somewhat what the code looks like. appreciate any help!
lakinmohapatra
@lakinmohapatra
Hi Guys

I have an user model which has following relation with address table .

@hasMany(() => UserAddress) addresses?: UserAddress[];

But in api explorer , its not showing any fields for entering address details for user controller .

Any suggestions on above will be greatly appreciated
Nico Flaig
@nflaig
@lakinmohapatra it is a relation not part of the user model itself. Take a look at the docs https://loopback.io/doc/en/lb4/HasMany-relation.html
Pradeep Kumar Tippa
@pktippa

In LoopBack 4, What is the right place to perform data transformation, Ex: converting all the snake case keys coming from datasource to camel case sending as REST response.?

@bajtos @dhmlau

Taskhyn Maksim
@sarbazx
how to use LoopBack 4 without typescript but just with ES06?
Darko Damljanović
@darko.damljanovic1_gitlab
@pktippa You need to confirm this, but Sequence or Interceptors sounds good. I think they act as a replacement for good old Express Middlewares we have been use to 😊
@bajtos Are there any words regarding postgresql support for foreign keys in either model or property decorator? We now have weak links, but we cannot use ER diagram to inspect database relationship at this point.
Reza
@rsa408
hi guys i have getting this error when using lb4 with mongodb:
{
"error": {
"statusCode": 422,
"name": "UnprocessableEntityError",
"message": "The request body is invalid. See error object details property for more info.",
"code": "VALIDATION_FAILED",
"details": [
{
"path": "",
"code": "not",
"message": "should NOT be valid",
"info": {}
}
]
}
}
with memory DB there is no issue but when adding MongoDB post API is making issue as I post above.
Warman Suganda
@warmansuganda
hi, how to defining custom keywords? i need add AJV keyword for Asynchronous validation in some controllers.
Ahmad Ali
@byAhmadAli
hello any example how to make live location in lp4 ?