Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit 6977a5e

Browse files
committed
new survey link
1 parent 4ba25da commit 6977a5e

File tree

6 files changed

+81
-13
lines changed

6 files changed

+81
-13
lines changed

public/dist/application.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ angular.module(ApplicationConfiguration.applicationModuleName)
6060
// enable this for speed enhancement b4 production push
6161
// $compileProvider.debugInfoEnabled(false);
6262
}])
63-
.config(function (typeformConfigProvider) {
64-
typeformConfigProvider.setAccount('justfix');
65-
})
6663
// .config(['$tooltipProvider', function($tooltipProvider){
6764
// $tooltipProvider.setTriggers({
6865
// 'mouseenter': 'mouseleave',
@@ -1646,12 +1643,14 @@ angular.module('admin').factory('Passwords', ['$resource',
16461643
'use strict';
16471644

16481645
//Setting up route
1649-
angular.module('advocates').config(['$stateProvider', '$urlRouterProvider',
1650-
function($stateProvider, $urlRouterProvider) {
1646+
angular.module('advocates').config(['$stateProvider', '$urlRouterProvider', 'typeformConfigProvider',
1647+
function($stateProvider, $urlRouterProvider, typeformConfigProvider) {
16511648

16521649
// Jump to first child state
16531650
// $urlRouterProvider.when('/advocate/signup', '/advocate/signup/create');
16541651

1652+
typeformConfigProvider.setAccount('justfix');
1653+
16551654
// Advocate state routing
16561655
$stateProvider
16571656
.state('advocateSignup', {

public/dist/application.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/application.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/modules/advocates/config/advocates.client.routes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ angular.module('advocates').config(['$stateProvider', '$urlRouterProvider', 'typ
77
// Jump to first child state
88
// $urlRouterProvider.when('/advocate/signup', '/advocate/signup/create');
99

10-
typeformConfigProvider.setAccount('laymanlee');
10+
typeformConfigProvider.setAccount('justfix');
1111

1212
// Advocate state routing
1313
$stateProvider

public/modules/advocates/partials/seth-low-survey.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<div class="page-header">
44
<h1 class="text-center" ng-if="!hasSubmittedForm">Seth Low TA Survey</h1>
55
<h1 class="text-center" ng-if="hasSubmittedForm">Survey Completed!</h1>
6-
</div>
6+
</div>
77
<div ng-if="!hasSubmittedForm">
88
<typeform-embed
9-
tf-id="UWUF4Z"
9+
tf-id="MIaKfT"
1010
tf-text="Any text that you want"
1111
tf-style="height:80vh; min-height:500px; width:100%;">
1212
</typeform-embed>

util/deleteTenant.js

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
'use strict';
2+
3+
var dbConnect = require('./dbConnect'),
4+
Q = require('q'),
5+
_ = require('lodash'),
6+
tenantProfileHandler = require('../app/controllers/tenants/tenants.authentication.server.controller.js'),
7+
User = dbConnect.mongoose.model('User'),
8+
Identity = dbConnect.mongoose.model('Identity'),
9+
Advocate = dbConnect.mongoose.model('Advocate'),
10+
Tenant = dbConnect.mongoose.model('Tenant');
11+
12+
var chalk = require('chalk'),
13+
prompt = require('prompt');
14+
15+
console.log('JustFix.nyc manual delete tenant system. Hello!');
16+
17+
var promptSchema = {
18+
properties: {
19+
tenantPhone: {
20+
description: 'Enter the tenants\'s phone number',
21+
required: true
22+
}
23+
}
24+
};
25+
26+
var total; // represents total number of docs to insert
27+
var advocate; // ref to advocate
28+
29+
prompt.start();
30+
31+
prompt.get(promptSchema, function (err, result) {
32+
33+
if(err) console.error(err);
34+
35+
var advocatePhone = result.advocatePhone;
36+
var tenantPhone = result.tenantPhone;
37+
38+
Advocate.findOne({ phone: result.advocatePhone })
39+
.then(function (advocate) {
40+
41+
if(!advocate) {
42+
throw new Error('no advocate found');
43+
} else {
44+
Tenant.findOne({ phone: result.tenantPhone })
45+
.then(function (tenant) {
46+
if(!tenant) {
47+
throw new Error('no tenant found');
48+
} else {
49+
tenant.sharing.enabled = true;
50+
tenant.advocateRole = 'linked';
51+
tenant.advocate = advocate._id;
52+
return tenant.save();
53+
}
54+
})
55+
.then(function (resullt) {
56+
console.log('updated', result);
57+
process.exit();
58+
})
59+
.catch(function (err) {
60+
console.error(err);
61+
process.exit(1);
62+
});
63+
}
64+
})
65+
.catch(function (err) {
66+
console.error(err);
67+
process.exit(1);
68+
});
69+
});

0 commit comments

Comments
 (0)