Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
nothing: ts dist
Browse files Browse the repository at this point in the history
  • Loading branch information
louis70109 committed Apr 17, 2020
1 parent a415244 commit aa637bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
27 changes: 5 additions & 22 deletions dist/controller/users/follow.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,41 +45,24 @@ var user_1 = require("../../model/user");
var Channels_1 = __importDefault(require("../common/Channels"));
function _findStreamNotifyList(userId, streams) {
return __awaiter(this, void 0, void 0, function () {
var $notify, userBindingStreams, idx, n_idx;
var $notify, streamNameList, notifyList;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, notify_1.StreamNotifyModel.find({ userId: userId })];
case 1:
$notify = _a.sent();
userBindingStreams = [];
for (idx = 0; idx < streams.length; idx++) {
for (n_idx = 0; n_idx < $notify.length; n_idx++) {
if (streams[idx].channel.name === $notify[n_idx].name) {
userBindingStreams.push($notify[n_idx].name);
break;
}
}
}
return [4 /*yield*/, userBindingStreams];
streamNameList = streams.map(function (el) { return el.channel.name; });
notifyList = $notify.map(function (el) { return el.name; });
return [4 /*yield*/, notifyList.filter(function (el) { return streamNameList.indexOf(el); })];
case 2: return [2 /*return*/, _a.sent()];
}
});
});
}
function _collectChannelIdList(follows) {
return __awaiter(this, void 0, void 0, function () {
var channel, i, follow;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
channel = [];
for (i = 0; i < follows.length; i++) {
follow = follows[i];
channel.push(follow.channel.id);
}
return [4 /*yield*/, channel];
case 1: return [2 /*return*/, _a.sent()];
}
return [2 /*return*/, follows.map(function (element) { return element.channel.id; })];
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions dist/model/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
var mongoose_1 = __importDefault(require("mongoose"));
var Schema = mongoose_1.default.Schema;
var User = new Schema({
var UserSchema = new Schema({
name: { type: String },
displayName: { type: String },
twitchId: { type: String, index: true },
createAt: { type: Date, default: Date.now },
userId: { type: String, unique: true, index: true },
});
var UserModel = mongoose_1.default.model('user', User);
var UserModel = mongoose_1.default.model('user', UserSchema);
exports.UserModel = UserModel;

0 comments on commit aa637bb

Please sign in to comment.