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
How to enable CORS? My loopback 4 application constantly blocks request from the outside source, even though, documentation says that CORS is enabled?
Abel
@0bot
Hi guys, is there any example to use Loopbackjs with i18n ?
Matthew Miller
@mamiller93
@darko.damljanovic1_gitlab did you figure out the authorization bearer in openapi question?
Eduardo Mazzucchelli
@emazzu
hi, how are you ?
I m going to use the loopback 3.3, I can do a docuement preview with loopback-component-storage ??
Jyoti Chhetri
@jyoti-openair

Hi, please anyone can suggest, I need to automatically fill a field by the loggedin userId.

ex; I have a model account which has field createdBy. I dont want to send createdBy from the front end but, want to set it as the loggedin user Id whenever new account is added. Is there a way to do this ?

Matthew Miller
@mamiller93
@jyoti-openair I would think you’d need to create a helper function that returns the logged in user and when you’re saving your instance of a model (through your repo), fill in that logged in user?
unless there’s another magical way in loopback that I don’t know of (not terribly familiar with it all yet)
or maybe there’s a binding that can give you the current user?!
Jyoti Chhetri
@jyoti-openair

@mamiller93 ok, I figured out using the after save hook, and updating the createdBy with the current user.

The problem now is ctx.options as well as ctx.hookState is empty. This is where I could access the logged in user

Matthew Miller
@mamiller93
@jyoti-openair you couldn’t get the current user at save but only after save?
Jyoti Chhetri
@jyoti-openair

@mamiller93 no,

Model.observe('after save', function(ctx, next) {
//could not get it here ctx.options and ctx.hookState is empty

});

Sebastian Torres
@SebTorres
Hello. Has anyone here implemented Auth0 in a LB4 app? I am kind of new ad having trouble with this
Darko Damljanović
@darko.damljanovic1_gitlab
@mamiller93 unfortortunatelly no. I had no luck how to add input field in swagger. I did however manage to visually represent that end point is secured (lock icon).
@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!