This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export abstract class RepoBase<T> extends Repository<T> { | |
async customFind(optionsOrConditions?: FindManyOptions<T> | Partial<T>) { | |
const connection = this.manager.connection; | |
const metadata = this.metadata; | |
if ( | |
metadata.deleteDateColumn && | |
optionsOrConditions && | |
'withDeleted' in optionsOrConditions && | |
!optionsOrConditions.withDeleted | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"experimentalDecorators": true, | |
"target": "ES2018", | |
"module": "CommonJS", | |
"moduleResolution": "node", | |
"esModuleInterop": true, | |
"emitDecoratorMetadata": true, | |
"resolveJsonModule": true, | |
"strictNullChecks": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var randomUser = unitOfWork.User.GetAll().Where(x => x.Email == "abc").FirstOrDefault(); | |
randomUser.EmailFe = ""; | |
unitOfWork.SaveChanges(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[When(@"create category has name ""(.*)"" and used in document")] | |
public void CreateCategoryWithDocument(string categoryName) | |
{ | |
UnitOfWork unitOfWork = (UnitOfWork)dependencyResolver | |
.GetService(typeof(UnitOfWork)); | |
var randomUser = unitOfWork.User.GetAll().FirstOrDefault(); | |
using (var transaction = unitOfWork.BeginTransaction()) | |
{ | |
try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var form = $('form'); | |
if (form.find('[data-val-remote]').length > 0) { | |
form.find('[type="submit"]').on("click enter", function (evt) { | |
var interval = setInterval(function () { | |
// keep check if there are any remote pending then prevent submit button from click | |
if (Object.keys($('form').validate().pending).length) { | |
evt.preventDefault(); | |
} else { | |
// if all remote were response check form valid or not | |
if (!form.valid()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request'); | |
const progress = require('request-progress'); | |
const fs = require('fs'); | |
function download(url) { | |
var timeout; | |
const rq = request | |
.get(url) | |
.on('connect', function(req, cltSocket, head) { | |
// Set timeout khi vừa connect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "attach", | |
"name": "WatchDebug", | |
"port": 9229, | |
"restart": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// launch.json | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "chrome", | |
"request": "launch", | |
"name": "client: chrome", | |
"url": "http://localhost:3000", | |
"webRoot": "${workspaceFolder}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-08-25T05:01:19.422Z","extensionVersion":"v3.4.3"} |
NewerOlder