Page 392 - Nodejs 교과서 개정2판
P. 392

.then((res)	=>	{
           												document.getElementById('img-url').value	=	res.data.url;
           												document.getElementById('img-preview').src	=	res.data.url;
           												document.getElementById('img-preview').style.display	=	'inline';
           										})
           										.catch((err)	=>	{
           												console.error(err);
           										});
           						});
           				}
           				document.querySelectorAll('.twit-follow').forEach(function(tag)	{
           						tag.addEventListener('click',	function()	{
           								const	myId	=	document.querySelector('#my-id');
           								if	(myId)	{
           										const	userId	=	tag.parentNode.querySelector('.twit-user-id').value;
           										if	(userId	!==	myId.value)	{
           												if	(confirm('팔로잉하시겠습니까?'))	{
           														axios.post(`/user/${userId}/follow`)
           																.then(()	=>	{
           																		location.reload();
           																})
           																.catch((err)	=>	{
           																		console.error(err);
           																});
           												}
           										}
           								}
           						});
           				});
           		</script>
           {%	endblock	%}




         NBJO IUNMীࢲח user ߸ࣻо ઓ੤ೡ ٸ ѱदӖ স۽٘ ಬਸ ࠁৈસפ׮  forޙب ୶оغ঻णפ׮  ۪؊݂ द

         twits ߓৌ উ੄ ਃٜࣗਸ ੍যࢲ ѱदӖ۽ ٟ݅פ׮  ૑Ә਷ ࠼ ߓৌ੉૑݅ ա઺ী twitsী ѱदӖ ؘ੉ఠܳ
         ֍ਵݶ ؾפ׮

         if	not	followerIdList.includes(twit.User.id)	and	twit.User.id	!==	user.idח ա੄ ౹۽ਕ ই੉٣

         ݾ۾ী ѱदӖ ੘ࢿ੗੄ ই੉٣о হਵݶ ౹۽਋ ߡౡਸ ࠁৈ઱ӝ ਤೠ ҳޙੑפ׮  ژೠ ѱदӖ ੘ࢿ੗о աੋ
         ҃਋ աܳ ౹۽਋ೡ ࣻח হѱ ೮णפ׮  if	notҗ andܳ ॄࢲ ৈ۞ о૑ ઑѤٜਸ ઑ೤೮णפ׮  ք੸झ ޙߨੑ

         פ׮

          views/profile.html

           {%	extends	'layout.html'	%}
   387   388   389   390   391   392   393   394   395   396   397