Compare commits
No commits in common. "25b573d3a405b01d97c25da7c14db3edcbfa4378" and "2210280eddd6bc80390fa3db4ff3f7161c6c603c" have entirely different histories.
25b573d3a4
...
2210280edd
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@ -1,11 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CommitMessageInspectionProfile">
|
|
||||||
<profile version="1.0">
|
|
||||||
<inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
||||||
<inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
|
@ -402,25 +402,7 @@ const MySqlService = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* Retrieves all categories from the database.
|
|
||||||
*
|
|
||||||
* @param {MysqlHandler} handler - The MySQL handler used for executing the query.
|
|
||||||
*
|
|
||||||
* @return {Promise<Array<IDbCategory>>} - A promise that resolves with an array of category objects from the database.
|
|
||||||
* - The category objects are of type IDbCategory.
|
|
||||||
* - If an error occurs, the promise will be rejected with an Error object.
|
|
||||||
*/
|
|
||||||
getAll(handler: MysqlHandler) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const _sql = "SELECT * FROM `categories`";
|
|
||||||
try {
|
|
||||||
resolve(handler.query(_sql) as unknown as Array<IDbCategory>);
|
|
||||||
} catch (err: unknown) {
|
|
||||||
reject(err as Error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user