Skip to content

Commit

Permalink
$$$ update $$$
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Apr 29, 2024
1 parent f28ab83 commit bf1b943
Show file tree
Hide file tree
Showing 16 changed files with 1,554 additions and 38 deletions.
7 changes: 3 additions & 4 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ class User extends Firedev.Base.AbstractEntity {
path: 'users',
})
class UserController extends Firedev.Base.CrudController<User> {
provider = this.inject(UserProvider);
userProviers = this.inject(UserProvider);

async initExampleDbData(): Promise<void> {
// console.log({ 'this.provider': this.provider });
// console.log(this.provider.helloFromUserProvier());
console.log(this.userProviers.helloFromUserProvier());
}


Expand Down Expand Up @@ -115,7 +114,7 @@ async function start(portForBackend?: string) {
console.log({ portForBackend })
console.log('Helpers.isElectron', Helpers.isElectron)
console.log('Your server will start on port ' + HOST_BACKEND_PORT);
console.log(UserContext.ref.allInstances);
console.log(UserContext.ref.allClassesInstances);

await UserContext.initialize({

Expand Down
2 changes: 1 addition & 1 deletion src/lib/base-classes/base-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export class BaseRepository
extends Repository<Entity>
//#endregion
{

// TOOD get connection first
}
10 changes: 10 additions & 0 deletions src/lib/create-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ export const createContext = <
beforeDbInited && await Helpers.runSyncOrAsync({
functionFn: beforeDbInited,
});
await ref.initDatabaseConnection();
await ref.initSubscribers();
ref.initializeMetadata();
//#region @websql
ref.writeActiveRoutes();
//#endregion
if (ref.admin && ref.admin.keepWebsqlDbDataAfterReload && !Helpers.isNode) {
Helpers.info(`[firedev] Keep websql data after reload`);
} else {
await ref.reinitControllersData();
}
await ref.reinitControllersData();
afterDbInited && await Helpers.runSyncOrAsync({
functionFn: afterDbInited
Expand Down
Loading

0 comments on commit bf1b943

Please sign in to comment.