poeti8 7 gadi atpakaļ
vecāks
revīzija
329ee372d4

+ 9 - 3
client/actions/auth.js

@@ -33,7 +33,9 @@ export const authRenew = () => ({ type: AUTH_RENEW });
 export const signupUser = payload => async dispatch => {
   dispatch(showSignupLoading());
   try {
-    const { data: { email } } = await axios.post('/api/auth/signup', payload);
+    const {
+      data: { email },
+    } = await axios.post('/api/auth/signup', payload);
     dispatch(sentVerification(email));
   } catch ({ response }) {
     dispatch(showAuthError(response.data.error));
@@ -43,7 +45,9 @@ export const signupUser = payload => async dispatch => {
 export const loginUser = payload => async dispatch => {
   dispatch(showLoginLoading());
   try {
-    const { data: { token } } = await axios.post('/api/auth/login', payload);
+    const {
+      data: { token },
+    } = await axios.post('/api/auth/login', payload);
     cookie.set('token', token, { expires: 7 });
     dispatch(authRenew());
     dispatch(authUser(decodeJwt(token)));
@@ -74,7 +78,9 @@ export const renewAuthUser = () => async (dispatch, getState) => {
   };
 
   try {
-    const { data: { token } } = await axios(options);
+    const {
+      data: { token },
+    } = await axios(options);
     cookie.set('token', token, { expires: 7 });
     dispatch(authRenew());
     dispatch(authUser(decodeJwt(token)));

+ 10 - 13
client/actions/settings.js

@@ -23,12 +23,11 @@ export const showDomainInput = () => ({ type: SHOW_DOMAIN_INPUT });
 
 export const getUserSettings = () => async dispatch => {
   try {
-    const { data: { apikey, customDomain, homepage, useHttps } } = await axios.get(
-      '/api/auth/usersettings',
-      {
-        headers: { Authorization: cookie.get('token') },
-      }
-    );
+    const {
+      data: { apikey, customDomain, homepage, useHttps },
+    } = await axios.get('/api/auth/usersettings', {
+      headers: { Authorization: cookie.get('token') },
+    });
     dispatch(setDomain({ customDomain, homepage, useHttps }));
     dispatch(setApiKey(apikey));
   } catch (error) {
@@ -39,13 +38,11 @@ export const getUserSettings = () => async dispatch => {
 export const setCustomDomain = params => async dispatch => {
   dispatch(showDomainLoading());
   try {
-    const { data: { customDomain, homepage, useHttps } } = await axios.post(
-      '/api/url/customdomain',
-      params,
-      {
-        headers: { Authorization: cookie.get('token') },
-      }
-    );
+    const {
+      data: { customDomain, homepage, useHttps },
+    } = await axios.post('/api/url/customdomain', params, {
+      headers: { Authorization: cookie.get('token') },
+    });
     dispatch(setDomain({ customDomain, homepage, useHttps }));
   } catch ({ response }) {
     dispatch(setDomainError(response.data.error));

+ 4 - 1
client/components/BodyWrapper/BodyWrapper.js

@@ -92,4 +92,7 @@ const mapDispatchToProps = dispatch => ({
   renewAuthUser: bindActionCreators(renewAuthUser, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(BodyWrapper);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(BodyWrapper);

+ 4 - 2
client/components/Footer/Footer.js

@@ -43,7 +43,8 @@ class Footer extends Component {
           Made with love by{' '}
           <a href="//thedevs.network/" title="The Devs">
             The Devs
-          </a>.{' | '}
+          </a>
+          .{' | '}
           <a
             href="https://github.com/thedevs-network/kutt"
             title="GitHub"
@@ -58,7 +59,8 @@ class Footer extends Component {
           {' | '}
           <a href="/report" title="Report abuse" target="_blank">
             Report Abuse
-          </a>.
+          </a>
+          .
         </Text>
       </Wrapper>
     );

+ 4 - 1
client/components/Header/Header.js

@@ -52,4 +52,7 @@ const mapDispatchToProps = dispatch => ({
   showPageLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(null, mapDispatchToProps)(Header);
+export default connect(
+  null,
+  mapDispatchToProps
+)(Header);

+ 4 - 1
client/components/Header/HeaderLeftMenu.js

@@ -56,4 +56,7 @@ const mapDispatchToProps = dispatch => ({
   showPageLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(null, mapDispatchToProps)(HeaderLeftMenu);
+export default connect(
+  null,
+  mapDispatchToProps
+)(HeaderLeftMenu);

+ 4 - 1
client/components/Header/HeaderRightMenu.js

@@ -83,4 +83,7 @@ const mapDispatchToProps = dispatch => ({
   showPageLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(HeaderMenu);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(HeaderMenu);

+ 4 - 1
client/components/Login/Login.js

@@ -168,4 +168,7 @@ const mapDispatchToProps = dispatch => ({
   showPageLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(Login);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(Login);

+ 10 - 3
client/components/Settings/Settings.js

@@ -105,7 +105,9 @@ class Settings extends Component {
 
   async onSubmitBan(e) {
     e.preventDefault();
-    const { ban: { domain, host, user } } = this.state;
+    const {
+      ban: { domain, host, user },
+    } = this.state;
     this.setState(state => ({
       ban: {
         ...state.ban,
@@ -226,7 +228,9 @@ class Settings extends Component {
   }
 
   render() {
-    const { auth: { user, admin } } = this.props;
+    const {
+      auth: { user, admin },
+    } = this.props;
     return (
       <Wrapper>
         <SettingsWelcome user={user} />
@@ -316,4 +320,7 @@ const mapDispatchToProps = dispatch => ({
   showDomainInput: bindActionCreators(showDomainInput, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(Settings);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(Settings);

+ 4 - 1
client/components/Shortener/Shortener.js

@@ -167,4 +167,7 @@ const mapDispatchToProps = dispatch => ({
   showShortenerLoading: bindActionCreators(showShortenerLoading, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(Shortener);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(Shortener);

+ 4 - 1
client/components/Stats/Stats.js

@@ -165,4 +165,7 @@ const mapDispatchToProps = dispatch => ({
   showPageLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(Stats);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(Stats);

+ 3 - 4
client/components/Stats/StatsCharts/withTitle.js

@@ -48,10 +48,9 @@ const withTitle = ChartComponent => {
           {props.periodText && <Count>{props.data.reduce((sum, view) => sum + view, 0)}</Count>}
           {props.periodText ? ` clicks in ${props.periodText}` : props.title}.
         </Title>
-        {props.periodText &&
-          props.updatedAt && (
-            <SubTitle>Last update in {formatDate(props.updatedAt, 'dddd, hh:mm aa')}</SubTitle>
-          )}
+        {props.periodText && props.updatedAt && (
+          <SubTitle>Last update in {formatDate(props.updatedAt, 'dddd, hh:mm aa')}</SubTitle>
+        )}
         <ChartComponent {...props} />
       </Wrapper>
     );

+ 4 - 1
client/components/Table/TBody/TBodyCount.js

@@ -106,4 +106,7 @@ const mapDispatchToProps = dispatch => ({
   showLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(null, mapDispatchToProps)(TBodyCount);
+export default connect(
+  null,
+  mapDispatchToProps
+)(TBodyCount);

+ 4 - 1
client/components/Table/Table.js

@@ -158,4 +158,7 @@ const mapDispatchToProps = dispatch => ({
   getUrlsList: bindActionCreators(getUrlsList, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(Table);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(Table);

+ 4 - 1
client/components/Table/TableOptions.js

@@ -197,4 +197,7 @@ const mapDispatchToProps = dispatch => ({
   getUrlsList: bindActionCreators(getUrlsList, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(TableOptions);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(TableOptions);

+ 2 - 1
client/pages/banned.js

@@ -58,7 +58,8 @@ class BannedPage extends Component {
               <a href="/report" title="Send report">
                 send us a report
               </a>
-            </Link>.
+            </Link>
+            .
           </Subtitle>
         </Wrapper>
         <Footer />

+ 4 - 1
client/pages/index.js

@@ -54,4 +54,7 @@ const mapDispatchToProps = dispatch => ({
   getUrlsList: bindActionCreators(getUrlsList, dispatch),
 });
 
-export default connect(mapStateToProps, mapDispatchToProps)(Homepage);
+export default connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(Homepage);

+ 4 - 1
client/pages/logout.js

@@ -19,4 +19,7 @@ LogoutPage.propTypes = {
 
 const mapDispatchToProps = dispatch => ({ logoutUser: bindActionCreators(logoutUser, dispatch) });
 
-export default connect(null, mapDispatchToProps)(LogoutPage);
+export default connect(
+  null,
+  mapDispatchToProps
+)(LogoutPage);

+ 3 - 1
client/pages/reset-password.js

@@ -61,7 +61,9 @@ class ResetPassword extends Component {
     if (this.state.loading) return null;
     e.preventDefault();
     const form = document.getElementById('reset-password-form');
-    const { email: { value } } = form.elements;
+    const {
+      email: { value },
+    } = form.elements;
     if (!value) {
       this.setState({ error: 'Please provide an Email address.' }, () => {
         setTimeout(() => {

+ 4 - 1
client/pages/verify.js

@@ -97,4 +97,7 @@ const mapDispatchToProps = dispatch => ({
   showLoading: bindActionCreators(showPageLoading, dispatch),
 });
 
-export default connect(null, mapDispatchToProps)(Verify);
+export default connect(
+  null,
+  mapDispatchToProps
+)(Verify);

+ 3 - 3
server/db/url.js

@@ -289,9 +289,9 @@ exports.deleteUrl = ({ id, domain, user }) =>
       .catch(err => session.close() || reject(err));
   });
 
-/* 
-** Collecting stats 
-*/
+/*
+ ** Collecting stats
+ */
 
 const initialStats = {
   browser: {