refactor(server): use insert instead of save
This commit is contained in:
		
							parent
							
								
									4a64280a7c
								
							
						
					
					
						commit
						6be1db00d1
					
				
					 9 changed files with 19 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -342,7 +342,7 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
 | 
			
		|||
 | 
			
		||||
		logger.info(`register emoji host=${host}, name=${name}`);
 | 
			
		||||
 | 
			
		||||
		return await Emojis.save({
 | 
			
		||||
		return await Emojis.insert({
 | 
			
		||||
			id: genId(),
 | 
			
		||||
			host,
 | 
			
		||||
			name,
 | 
			
		||||
| 
						 | 
				
			
			@ -350,6 +350,6 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
 | 
			
		|||
			url: tag.icon!.url,
 | 
			
		||||
			updatedAt: new Date(),
 | 
			
		||||
			aliases: [],
 | 
			
		||||
		} as Partial<Emoji>);
 | 
			
		||||
		} as Partial<Emoji>).then(x => Emojis.findOneOrFail(x.identifiers[0]));
 | 
			
		||||
	}));
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue