4.6.7-alpha commit (#743)

Co-authored-by: Archer <545436317@qq.com>
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-01-19 11:17:28 +08:00
committed by GitHub
parent 8ee7407c4c
commit c031e6dcc9
324 changed files with 8509 additions and 4757 deletions

View File

@@ -8,7 +8,7 @@ import {
import { MongoTeamMember } from './teamMemberSchema';
import { MongoTeam } from './teamSchema';
async function getTeam(match: Record<string, any>): Promise<TeamItemType> {
async function getTeamMember(match: Record<string, any>): Promise<TeamItemType> {
const tmb = (await MongoTeamMember.findOne(match).populate('teamId')) as TeamMemberWithTeamSchema;
if (!tmb) {
@@ -31,11 +31,11 @@ async function getTeam(match: Record<string, any>): Promise<TeamItemType> {
};
}
export async function getTeamInfoByTmbId({ tmbId }: { tmbId: string }) {
export async function getTmbInfoByTmbId({ tmbId }: { tmbId: string }) {
if (!tmbId) {
return Promise.reject('tmbId or userId is required');
}
return getTeam({
return getTeamMember({
_id: new Types.ObjectId(tmbId),
status: notLeaveStatus
});
@@ -45,7 +45,7 @@ export async function getUserDefaultTeam({ userId }: { userId: string }) {
if (!userId) {
return Promise.reject('tmbId or userId is required');
}
return getTeam({
return getTeamMember({
userId: new Types.ObjectId(userId),
defaultTeam: true
});

View File

@@ -24,11 +24,11 @@ const TeamSchema = new Schema({
},
balance: {
type: Number,
default: 2 * PRICE_SCALE
default: 0
},
maxSize: {
type: Number,
default: 5
default: 3
},
limit: {
lastExportDatasetTime: {
@@ -41,7 +41,7 @@ const TeamSchema = new Schema({
});
try {
TeamSchema.index({ lastDatasetBillTime: -1 });
// TeamSchema.index({ createTime: -1 });
} catch (error) {
console.log(error);
}